NAV 2009 Web Services (Part 3 – finally a web service!)

Up to this point we have been preparing the structures needed to support our application. We have created the traditional simple tables and forms, as well as gone through the process of generating some pages equivalent to those forms. The entire reason for the latter work was that it is only possible to expose pages or codeunits via web services.

Thankfully the task of registering and publishing a web service from within NAV is a very, very simple affair.

From within the Classic client navigate to, and run form 810 – Web Service.

Our first task is simply going to be to get a list of Vehicle records out of NAV. In order to do this we will need to expose our Vehicle List page (in my case this is page 50002).

To do this we simply select the Object Type = Page, enter the Object ID = 50002; give the service a name = Vehicle, and tick the published flag.

Next we need to make sure that the NAV Web Service service is actually running. This can be done by checking the services.msc for your machine.

In my case I have created a second set of middle tier services (thanks to FreddyK and the following posting: ), but the one I am interested in here is the highlighted web services – DEV service. As we can see this is running as required.

So how do I make sure that something is actually being exposed before we look at consuming the web service (in the next post)? The answer is that we must verify our web service availability. We do this by navigating to the following URL in our web browser of choice:


NOTE: The company name is optional and case-sensitive and the rest of the values can be found in your CustomSettings.config file.

In my case this converts to: http://localhost:7047/Dev/WS/services

Success!!!! The Vehicle page has been published and is exposing itself via the port specified.

Next time we actually get to something where I really am going to start to learn as I go – we will try to write an application in C# to retrieve our data via the web service. As I've mentioned a few times, and as the Microsoft Statement of Direction (see: ) mentions we are moving more and more towards using a .NET programming environment so I need to make sure that I am familiar with this environment as soon as possible. I see the current touch point as the web services so getting familiar with these and exploring exactly how to interact with and consume them is where my current focus is.

Comment List