Navision 50, SOAP and XML

MrAbbeyMrAbbey Member Posts: 15
Hi @ all there,

I'm trying to develop an WebService-Connection for Navision.
Now i got a problem.

I'm using the objects from PrebenRasmussen
http://www.mibuso.com/forum/viewtopic.php?t=8782&highlight=soap and it works fine with simple data.

But I don't know how to get teh data in Navision if there are in a list or an array:

An Exampel:
<item xsi:type="ns1:Vt">
<vtid xsi:type="xsd:int">1</vtid>
<tid xsi:type="xsd:string">plus</tid>
<nid xsi:type="xsd:int">2</nid>
<pid xsi:type="xsd:int">6</pid>
<mkz xsi:type="xsd:float">0</mkz>
</item>
<item xsi:type="ns1:Vt">
<vtid xsi:type="xsd:int">2</vtid>
<tid xsi:type="xsd:string">minus</tid>
<nid xsi:type="xsd:int">2</nid>
<pid xsi:type="xsd:int">6</pid>
<mkz xsi:type="xsd:float">0</mkz>
</item>
<item xsi:type="ns1:Vt">
<vtid xsi:type="xsd:int">3</vtid>
<tid xsi:type="xsd:string">mal</tid>
<nid xsi:type="xsd:int">2</nid>
<pid xsi:type="xsd:int">6</pid>
<mkz xsi:type="xsd:float">0</mkz>
</item>
<item xsi:type="ns1:Vt">
<vtid xsi:type="xsd:int">4</vtid>
<tid xsi:type="xsd:string">durch</tid>
<nid xsi:type="xsd:int">2</nid>
<pid xsi:type="xsd:int">6</pid>
<mkz xsi:type="xsd:float">0</mkz>
</item>

How can i get this 4 items in an separated way?

The second problem is the sending of lists. The WebService is waiting for some data in an array:
<ArtKalkek xsi:type="urn:ArtKalkekList" soapenc:arrayType="urn:ArtKalkek[]">

This is my Code:

locautSoapSerializer.startBody;
locautSoapSerializer.startElement('SetArtvks');

locautSoapSerializer.startElement('login');
locautSoapSerializer.writeString('XXX');
locautSoapSerializer.endElement;

locautSoapSerializer.startElement('password');
locautSoapSerializer.writeString('XXX');
locautSoapSerializer.endElement;

locautSoapSerializer.startElement('ArtKalkek');
locautSoapSerializer.startElement('Item');
//Artikelid
locautSoapSerializer.startElement('artid');
locautSoapSerializer.writeString('i');
locautSoapSerializer.endElement;

//EK Preis
locautSoapSerializer.startElement('vk');
locautSoapSerializer.writeString('10');
locautSoapSerializer.endElement;

//VK Brutto
locautSoapSerializer.startElement('eadavk');
locautSoapSerializer.writeString('11');
locautSoapSerializer.endElement;

//Gültig Ab Datum
locautSoapSerializer.startElement('abDatum');
locautSoapSerializer.writeString('20071001');
locautSoapSerializer.endElement;
locautSoapSerializer.endElement;
locautSoapSerializer.endElement;

locautSoapSerializer.endElement;
locautSoapSerializer.endBody;

but i always get an Error from the WebService.

Is anyone able to help me with my Array Problems?

Thanx, Oli

Comments

  • jlandeenjlandeen Member Posts: 524
    What is the exact error message that you are getting back from the web service when you're sending your SOAP message?

    I find that it's best to check out other Newsgroups and parts of the iNet (MSDN, Technet are good ones) to find solutions to errors with external controls.
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • MrAbbeyMrAbbey Member Posts: 15
    It isnt a real Error Message. The Answer from the Web Services means, that there is an Error in the data, that i sent.
  • MrAbbeyMrAbbey Member Posts: 15
    I got it :D


    For the incomming Array:

    XmlNode := SelectSingleNode('XYZ');
    If XmlNode.hasChildNodes Then Begin
    XmlNodeList := XmlNode.childNodes;
    For X := 0 To XmlNodeList.length - 1 do
    XmlNode1 := XmlNodeList(X);
    ….
    end;
    end;

    For the outgoing data was it the correct code. The web services is case sensitive and I wrote "Item" instead of "item".

    Since two Weeks I', looking for a good Book or artikel wich is explaning the MSXML.dll V5. can anyone give me a hint?

    MrAbbey
Sign In or Register to comment.