Data, Development Tips, How To, Information, Tip & Tricks, Web Services, XMLports

Exposing & Consuming the Web service from & inside Navision – Part-2

Continuing from my previous post. Find the link to access the same in case you missed it.

Exposing & Consuming the Web service from & inside Navision – Part-1


Step 1: Create a XML Port to Export Data in XML Format using XMLPort and save at some specified Location.

Here we will be creating just for demo purpose simple XMLPort for Exporting Data from Navision Database in XML Format.


We are using very simple structure for our XMLPort.

Make sure you set the properties accordingly as we are exporting the data in XML Format.


Save the XMLPort at available id and suitable name.


Step 2: Create a Codeunit to call XML Port and retrieve data in XML Format in Text Variable.

Here we will create a Codeunit with few helpful functions which will call the XMLPort to Export the data and save in temp file.

Further retrieve the data from the file in XML Format.

Return the data retrieved above to the calling program/ function.

To start with let us start with creating some Global Variables.


Next we will add one Function as below.


Next we will add one more Function as below.


Save the Codeunit at available Id and suitable Name.


Step 3: Expose/Publish the Codeunit as web service.

Open Web Services Page and add your Codeunit created above. Use your relevant ID on which you saved your Codeunit.



Tick the Published to Expose the Codeunit as Web Service.

Rest in my Next post.

To Be Continued……


2 thoughts on “Exposing & Consuming the Web service from & inside Navision – Part-2”

Comments are closed.