Tuesday, 26 April 2016

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.

WebServiceUsage-2

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.

WebServiceUsage-3

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.

WebServiceUsage-4

Next we will add one Function as below.

WebServiceUsage-5

Next we will add one more Function as below.

WebServiceUsage-6

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.

WebServiceUsage-7

 

Tick the Published to Expose the Codeunit as Web Service.

Rest in my Next post.

To Be Continued……

2 comments: