What is the right way to send xml over tcp?
The command was explained like this (the xml part is just an example):
* Add\r\n * <id>\r\n * <xml><data></data></xml>\r\n\r\n
Before sending the msg to a tcp-out Node I coded in a function Node :
var buf1 = Buffer.from("ADD\r\n4\r\n", 'utf8'); var buf2 = Buffer.from("<xml><data></data></xml>", 'utf8'); var buf3 = Buffer.from("\r\n\r\n", 'utf8'); var arr = [buf1, buf2, buf3]; msg.payload = Buffer.concat(arr); return msg;
but this way my command didn't work. Perhaps the xml entities should be converted first. I'm not shure about this. Other commands without the xml part work this way.