Options

send xml to webservice from navision

myo007myo007 Member Posts: 2
Hi,

I'm running in to a big problem. I need to send some xml requests to a webservice, within Navision.
I tried to do it with the soaptool kit, but this doesn't work.

Situation:
Connect to https webservice with passing username and password.
Building XML without making a file
sending XML.
Receiving XML answer from webservice.

Does anybody has sample code?
With some explanation!

Thx

Comments

  • Options
    kinekine Member Posts: 12,562
    I will try to guide you somehow. I will assume, that the XML is generated through XMLPort. I cannot post full code for you (because it is company property), but I will try do describe it:

    1) SOAP request is XML, I recommend to use the SOAPUI application to test the webservices and examining the request XML and answers
    2) SOAP toolkit will only help you to create the XML and send it
    3) You need to use SOAP toolkit to generate whole XML request, because there is no way how to insert one part from another source (e.g. XMLPort)
    4) XMLPort can be written into temporary BLOB field and read back from there through streams without inserting, modifying the record...
    5) To insert the XML into the SOAP request, you can go through the XML by using 'Microsoft XML, v6.0'.IXMLDOMNode and 'Microsoft XML, v6.0'.IXMLDOMNodeList automation and creating the elements of the SOAP based on that (it means, load the stream into XMLDOM automation and going through it by using the XMLDOM functions) - based on that you can call the StartElement, WriteString and EndElement of the SOAP Toolkit.
    6) Learn how to trace SOAP request e.g. by tools in SOAP SDK. It will help you to see what you are really sending. Compare it with the request generated by SOAPUI application.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    garakgarak Member Posts: 3,263
    i belive on ara3n's BLOG was also an example.
    Do you make it right, it works too!
  • Options
    ara3nara3n Member Posts: 9,256
    You can look at this post.

    http://mibuso.com/blogs/ara3n/2009/01/2 ... companies/

    or this one

    http://mibuso.com/blogs/ara3n/2008/03/


    or this one.

    http://mibuso.com/blogs/ara3n/2009/02/


    I will try to post a detailed step by step process on how to use web services.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.