Hello everybody,
pls can you help me?
I created codeunit for sending xml to my other application (.NET). With smaller xml i haven't problem, communication is OK. But if I try send larger xml, NAV return error
"The length of the string exceeds the size of the string buffer".
For communication i used navision communication component 2 (CC2) and Navision Socket Bus Adapter (SBA). Other variable are OutMsg : CC2.Outmessage, OutS : OutStream, xmlout : XmlDocument
my code:
IF ISCLEAR(CC2) THEN
CREATE(CC2);
IF ISCLEAR(xmlout) THEN
CREATE(xmlout);
IF ISCLEAR(SBA) THEN
CREATE(SBA);
CC2.AddBusAdapter(SBA, 0);
xmlout.load(FORMAT('C:\temp\c.xml')); // load large xml
OutMsg:= CC2.CreateoutMessage('Sockets://192.168.1.1:3000');
OutS:= OutMsg.GetStream();
OutS.WRITE(xmlout.xml); // here is problem with xml size
OutMsg.Send(0);
Some idea, pls?? Is it possible send xml document direct to CC2.OutMessage without normal outstream ?? or? ..
Very thanks for help
Comments
small change was necessary.
instead OutS.WRITE(xmlout.xml);
You could look to ADO Stream, but not sure - never used CC2... What else metods got your automation? What datatypes it can accept?