Soap and Instream

I have a web service that I am trying to use. I am building the XML using XML DOM and I can pass this to web service sucessfully:

SoapSerialize.startBody;
//SoapSerialize.writeXML(’’](http://tempuri.org/">’) + XMLDom.Text + ‘’);
SoapSerialize.endBody;

This works fine, but will, of course, fail if the text exceeds the max length of the string.

I have tried creating an instream to real the XML however using INSTREAM.EOS to check for the end of stream will crash the Navision Client (v4 SP1 Sql) [:@]. Im sure there is an easy way of doing this but what is this best way of getting the data from the XMLDOM to the webservice via SOAP .

Any suggestions greatly appreciated

Unfortunately you cannot get Navision to work with any strings greater than 1024, including where a string is a parameter in an Automation function.

The SoapSerializer object does not seem to be of any use here, you need a COM object that accepts objects as parameters (such as an XML Document or a Stream).

You don’t neccessarily need to use the SoapSerializer object to create a SOAP message - you can create it manually as an XML document. Then you just need to get something to do the HTTP Post with the XML document.

However, what we generally end up doing is adding a new function to our own DLL that contains all the functions we need to use long strings with. It’s just easier that trying to find a workaround within the Navision database model.

Hello what you need to do is build it manually instead of passing as string. Something like this.

CREATE(locautSoapHttpConnector);
locautSoapHttpConnector.Property(‘EndPointURL’, ‘http://localhost/WS_Test1/ServiceClass.asmx’);
locautSoapHttpConnector.Connect;
locautSoapHttpConnector.Property(‘AuthUser’, ‘User’);
locautSoapHttpConnector.Property(‘AuthPassword’, ‘Password’);
locautSoapHttpConnector.Property(‘Timeout’, 5 * 1000);
locautSoapHttpConnector.Property(‘SoapAction’,‘http://tempuri.org/WS_Test1/ServiceClass/Math_Cos’);
locautSoapHttpConnector.BeginMessage;

CREATE(locautSoapSerializer);
locautSoapSerializer.Init(locautSoapHttpConnector.InputStream);
locautSoapSerializer.startEnvelope(‘SOAP’,‘STANDARD’);
locautSoapSerializer.startBody;
locautSoapSerializer.startElement(‘Math_Cos’);
locautSoapSerializer.startElement(‘Angle’);
locautSoapSerializer.writeString(‘45’);
locautSoapSerializer.endElement;
locautSoapSerializer.endElement;

locautSoapSerializer.endBody;
locautSoapSerializer.endEnvelope;
locautSoapHttpConnector.EndMessage;

CREATE(locautXmlDoc);
locautXmlDoc.load(locautSoapHttpConnector.OutputStream);
locautXmlDoc.save(‘c:\temp2.xml’);