Tuesday 29 July 2014

NAV RTC - Introduction to Web Services.

Hi all,

This post is a introduction post about web services in Navision.

Agenda for this post -

1) Types of Web Services.
2) Differences between types of web services.
3) How to publish a web service.
4) How to see the published web service in Internet Explorer.
5) How to check all Published Web services.

Part 1 - Types of web Services?

NAV 2009, 2009 SP1 and 2009 R2 -

In these versions of Navision we had only one type of web service i.e SOAP Web services. It is an XML based protocol for accessing Web Services.

NAV 2013, NAV 2013 R2 -

With NAV 2013 Microsoft have come up with two types of web services i.e SOAP web services and ODATA web services.

Part 2 - How these Two Services Differ in Navision?

With SOAP Web Services you can publish either Microsoft Dynamics NAV pages or codeunits as SOAP services.

With ODATA web Services you can publish either pages or queries as OData services.

Part 3 - How to publish a web service?

*Following Screenshot are from NAV 2013 R2.

1. Open Role Tailored Client.

2. Navigate to - Departments/Administration/IT Administration/General/Web Services.

3. Click New.

4. Select the Object Type, Object No and Provide a Name to the Web Service.

5. Click on Published.

As i have created a Page web service i have both the URL i.e SOAP and ODATA.




But if i select a codeunit as shown below, i will get only SOAP URL and ODATA will be Not applicable. In the same way If i select a query i will only get URL for ODATA not for SOAP.



Till NAV 2009 R2 we don't get the URL for the web service published.

Part 4 - How to see the published web service in Internet Explorer?

You can copy the URL Generated in web Services Page and run that URL in Internet Explorer.

SOAP Web Service


ODATA Web Service


The Screen Shot Above shows the exposed Page Customer in Internet Explorer.


Part 5 - How to check all Published Web services?

If you would like to see what all objects have been published in a web services you can follow below steps -

SOAP WEB SERVICE -

FOR SOAP Web Services you can use below format as URL in Internet Explorer -
http://ServerName:PortNo/Instance Name/WS/Services

In my case i am using below URL
http://localhost:7047/DynamicsNAV71/WS/Services




ODATA WEB SERVICE -

For ODATA Web Services you can use below format as URL in Internet Explorer -
http://ServerName:PortNo/Instance Name/OData/

In my case i am using below URL
http://localhost:7048/DynamicsNAV71/OData


I hope you would have get some basic Ideas about web services.


Regards,
Sathish


No comments:

Post a Comment