web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Read external xml data in NAV 2013

(0) ShareShare
ReportReport
Posted on by 1,144

Dear All,

I want to read the xml data which I'm receiving from a External Web Service. A method of that WS is giving the required information in a xml format.

How to do it ?

*This post is locked for comments

I have the same question (0)
  • mmv Profile Picture
    11,471 on at

    Hi,

    You may create a Webservice at your end and publish it.  When the third party wants to send the XML file, they will call your published Webservice method.  In the Method, one of the Parameter must be an XMLDocument.

    You may check the below links:

    http://geekswithblogs.net/tburger/archive/2013/09/22/dynamics-nav-2013-consuming-a-rest-web-service-using-dotnet.aspx

  • subrata.bauri Profile Picture
    1,144 on at

    Thank you for your instant reply.

    Do you have any other solution for this case ?

  • mmv Profile Picture
    11,471 on at

    Hi,

    Do you mean that you don't want to use the Webservice?

  • subrata.bauri Profile Picture
    1,144 on at

    Yes. I don't  want to publish nav ws.

    I want to uses Automation/DotNet variable to grab the the flying information.

  • mmv Profile Picture
    11,471 on at

    Hi,

    But, if you are simply using the automation variable, what would be your trigger point to grab the information?

    You may think of a scheduler job which will fetch data from a specific path upon certain intervals.  The job in the scheduler could be a code unit to import the data (via an xmlport).

  • subrata.bauri Profile Picture
    1,144 on at

    Thanks for your reply!

    The external Web Service provides me a three columns' information ( which I don't need to store in my nav table).

    I have already used the others methods/functions from the same WS but I'm not able to read the xml  data from WS's method which I need most

  • subrata.bauri Profile Picture
    1,144 on at

    Yes, I know that when I need to call the WS method to get the information (from the xml data).

    I need when I'm doing any Sales Invoice posting. This is trigger point.

    BTW, thanks for your reply.

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Hi, If  you want to read the xml you can check various examples in standard codeunits one codeunit to check is 10145 it has functions to create and read, for reading check ProcessSalesInvoice...

    Please understand that is an example you have to modify based upon your xml schema.

    Also check 9610 codeunit.

  • Suggested answer
    4BzSoftware Profile Picture
    6,073 on at

    Hi Subrata,

    As your requirement, take a look at codeunit 1290 Web Service Request Mgt.

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    for consuming an external web service in navision you could start with:

    - msdn.microsoft.com/.../hh169399(v=nav.70).aspx

    - vjeko.com/.../web-services-black-belt-consuming-nav-web-services-using-pure-cal

    a simple codeunit to start:

    - www.mibuso.com/dlinfo.asp

    working with .net webrequests is maybe the solution for you:

    msdn.microsoft.com/.../hh534080.aspx

    you could use following code (in c#) to get the xml message directly:

    HttpWebRequest request = WebRequest.Create(requestUrl) as HttpWebRequest;

    HttpWebResponse response = request.GetResponse() as HttpWebResponse;

    XmlDocument xmlDoc = new XmlDocument();

    xmlDoc.Load(response.GetResponseStream());

    this code needs to be "translated" for usage in nav c/al.

    alternativly: develope a .net assembly which covers that code and delivers a simple interface for usage in c/al.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans