Notifications
Announcements
No record found.
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
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
Thank you for your instant reply.
Do you have any other solution for this case ?
Do you mean that you don't want to use the Webservice?
Yes. I don't want to publish nav ws.
I want to uses Automation/DotNet variable to grab the the flying information.
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).
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
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.
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.
Hi Subrata,
As your requirement, take a look at codeunit 1290 Web Service Request Mgt.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.