·
2 min read

Creating a web service manually, the importance of the name you give it, and a few small things to remember

When you use the SC command line command to create a new NAV 2009 Service, how does the new service know whether it is a middle tier for RTC to connect to, or whether it is supposed to handle web service calls?

In other words, what decides whether the new service will be “Microsoft Dynamics NAV Server” or “Microsoft Dynamics NAV Business Web Services”?

It depends on the name. If it starts with “MicrosoftDynamicsNavWS”, then it will be for Web Services. If the name starts with anything else, then it will be for middle tier for RTC clients.

To keep things simple, just give your NAV Servers names beginning with MicrosoftDynamicsNAV / MicrosoftDynamicsNAVWS. Then if you need a second, third, etc server, add a unique name, seperated by a $-sign, for example:

MicrosoftDynamicsNAV$Svr2

MicrosoftDynamicsNAVWS$Svr2

Here are the simple steps for how to create a new web service service, and a few more things to be aware of. Let’s say that we want to start a second set of NAV Servers.

First create the normal service from a command prompt:

SC CREATE “MicrosoftDynamicsNAV$Svr2” binpath= “C:\Program Files\Microsoft Dynamics NAV\60\Service2\Microsoft.Dynamics.Nav.Server.exe” DisplayName= “MSSvr2”

Then create the service for Web Services:

SC CREATE “MicrosoftDynamicsNAVWS$Svr2″ binpath= “C:\Program Files\Microsoft Dynamics NAV\60\Service2\Microsoft.Dynamics.Nav.Server.exe $Svr2” DisplayName= “MSWSSvr2” type= share

The additional settings you must provide as marked in bold above, and a few things that you must remember are:

1)  The Name

As described, the name must begin with MicrosoftDynamicsNAVWS if you want it to be for web services

2)  Include the last part of the name in BinPath

After the .exe in the binpath parameter you must specify the part of the name ($Svr2 in this case) that comes after MicrosoftDynamicsNAVWS. If you forget this step, you might get this error when you try to start the service:

Windows could not start the MSWSSvr2 service on Local Computer.Error 1083: The executable program that this service is configured to run in does not implement the service.

3)  Type must be share

For the service that handles web services, add the parameter type= share. Otherwise the service will still try to start up as a middle tier (not for web services).

4)  Spaces after =

You must remember the space after each = in the command, as in for example “type= share”. This is just the syntax of the SC-command.

5)  DisplayName

It doesn’t matter what display name you give – this is just to find it in Services.