How to connect to a webservice w/o "Expect 100 continue"

Peter_KuiperPeter_Kuiper Member Posts: 19
From Navision I want to connect to a webservice, but this webservice doesn't support "100 continue". I'm using the following code in Navision to connect to the webservice.
IF ISCLEAR(SoapHttpConn) THEN 
  CREATE(SoapHttpConn);
SoapHttpConn.Property('EndPointURL', MyEndpointURL);

SoapHttpConn.Connect;
SoapHttpConn.Property('SoapAction', 'getAddress1');

SoapHttpConn.BeginMessage;
IF ISCLEAR(SoapSerialize) THEN
  CREATE(SoapSerialize);

SoapSerialize.Init(SoapHttpConn.InputStream); 
SoapSerialize.startEnvelope('','http://schemas.xmlsoap.org/soap/encoding/');

SoapSerialize.SoapNamespace('xsi', 'http://www.w3.org/2001/XMLSchema-instance');
SoapSerialize.SoapNamespace('soap', 'http://soapserver.jsm.marktselect.com');
SoapSerialize.SoapNamespace('soapenv', 'http://schemas.xmlsoap.org/soap/envelope/');
SoapSerialize.SoapNamespace('xsd', 'http://www.w3.org/2001/XMLSchema');

SoapSerialize.startBody;
SoapSerialize.startElement('getAddress1', 'MSAddressDirect', '', 'method' );

//parameter 'username':
SoapSerialize.startElement('username');
SoapSerialize.SoapAttribute('type','','xsd:string', 'xsi' );
SoapSerialize.writeString(MyUsername);
SoapSerialize.endElement;

//... more parameters cut out...

SoapSerialize.endElement;
SoapSerialize.endBody;
SoapSerialize.endEnvelope;
SoapHttpConn.EndMessage;

IF ISCLEAR(XmlDom) THEN 
  CREATE(XmlDom);
XmlDom.load(SoapHttpConn.OutputStream);
XmlDom.save('c:\temp\temp.xml');

This code makes use of the following Microsoft objects:
SoapHttpConn	'Microsoft Soap Type Library'.HttpConnector	
SoapSerialize	'Microsoft Soap Type Library'.SoapSerializer	
XmlDom		'Microsoft XML, v5.0'.DOMDocument

The problem is that these Microsoft automation servers use the standard behavior of sending 2 http-messages. The first message only contains the headers (and one header "Expect: 100 Continue"), while the second message contains the SOAP message itself. My webservice doesn't support this way of communication yet.

In, for example VB, you can manipulate this default behavior of the webservice-client by setting the following property
System.Net.ServicePointManager.Expect100Continue = False

My question is: how do I do something equivalent in Navision with the objects I'm using? Or is there another way to connect to webservices from Navision that do have the possibility of disabling the Expect100Continue-behavior?

Thanks in advance for any help,
Peter
Sign In or Register to comment.