Options

Error when using Soap Toolkit from rtc client in NAV 2009 R2

pafutipafuti Member Posts: 2
edited 2012-01-18 in NAV Three Tier
Hi,

I have set up a webservice call using Microsoft Soap Toolkit V3.

When I call it from the Classic Client it works perfectly fine.

When I call it from the Rtc Client it give this error:

The call to member EndMessage failed: The current setting of the WriteMode property is incompatible with the operation.

I have build the code like this:
Name	    DataType	Subtype	
Serializer	    Automation	'Microsoft Soap Type Library v3.0'.SoapSerializer30	
Connector   Automation	'Microsoft Soap Type Library v3.0'.HttpConnector30	
XMLDOM	    Automation	'Microsoft XML, v6.0'.DOMDocument	

IF ISCLEAR(Connector) THEN
  CREATE(Connector);

Connector.Property('EndPointURL',WsdlUrl);
Connector.Connect;
Connector.Property('SoapAction',SoapActionMethod);

Connector.BeginMessage;

CREATE(Serializer);
Serializer.Init(Connector.InputStream);

Serializer.StartEnvelope('','STANDARD','utf-8');
  Serializer.StartHeader;
    Serializer.StartElement('ServiceAuthenticationHeader',Url);

      Serializer.StartElement('Username',Url);
      Serializer.WriteString(Username);
      Serializer.EndElement;

      Serializer.StartElement('Password',Url);
      Serializer.WriteString(Password);
      Serializer.EndElement;

    Serializer.EndElement;
  Serializer.EndHeader;

  Serializer.StartBody('STANDARD');

    Serializer.StartElement(ElementName,url');
    Serializer.WriteString(ElementValue);
    Serializer.EndElement;

  Serializer.EndBody;
Serializer.EndEnvelope;

Connector.EndMessage; (It is here it fails when calling from the rtc client)

IF ISCLEAR(XMLDOM) THEN
  CREATE(XMLDOM);
XMLDOM.load(Connector.OutputStream);
XMLNode := XMLDOM.selectSingleNode('//valid');
IF NOT ISCLEAR(XMLNode) THEN
  MESSAGE(XMLNode.text);
XMLDOM.save('c:\orderinit.xml');
CLEAR(XMLDOM);
CLEAR(Connector);
Any Ideas ?

Comments

  • Options
    RadoARadoA Member Posts: 4
    Something new? I have the same problem.
  • Options
    absolutelyfreewebabsolutelyfreeweb Member Posts: 104
    did you find a solution?
  • Options
    absolutelyfreewebabsolutelyfreeweb Member Posts: 104
    Hi, recommendation from microsoft is to replace ms soap toolkit 3.0 with serverxmlhttp60. This is what I had to do.
  • Options
    mihail_kolevmihail_kolev Member Posts: 379
    did you try to change the CREATE calls?
    ...
    CREATE(Connector,FALSE,ISSERVICETIER);
    CREATE(XMLDOM,FALSE,ISSERVICETIER);
    ...
    
    -Mihail- [MCTS]
Sign In or Register to comment.