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

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

  • Comments 14

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.

 

These are just some of the small things to keep in mind. For many more details on web services go to Freddys blog, especially this post:

Multiple Service Tiers - SP1

 

// Lars Lohndorf-Larsen

 

Leave a Comment
  • Please add 7 and 8 and type the answer here:
  • Post
  • This really helped me out.  Thanks so much.

  • Nice post. This should be in the install guide on the Dynamics NAV package.

  • Nice. Much better explanation than the msdn web page. the "type= share" thing is excelent.

  • +1000 Thank you very much. I was exhausted looking for that.

  • thank you so much is really usable!!!!!!!!

  • Excellent posting!

    Imho the "$<servername>" after the binary path should also be added for the normal service. Otherwise if more than one middle tier is running on the same machine all of the services use the same working directory in "c:\ProgramData". Tested with R2.

  • I thought I added this comment here before, but of course when I went to look it up, I couldn't find it.

    So, above is a description of adding $SvrName to the BinPath when creating a new instance of a NAV Server. What if you want to modify an existing instance? You don't need to remove it and then create it again. Just add $Xyz to the Image path under this key in registry:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MicrosoftDynamicsNAV\ImagePath

    For example, I had a value in ImagePath of:

    C:\Clients\W1600R2RTM\Server\Microsoft.Dynamics.Nav.Server.exe

    Then to update this NAV Service instance with a name, just add " $[AnythingYouLike]", like this:

    C:\Clients\W1600R2RTM\Server\Microsoft.Dynamics.Nav.Server.exe $Svr2

  • I tad late (NAV 2013 is almost coming), but shouldn't the name of the Navision server start with MicrosoftDynamicsNAVServer$name ?

  • Thanks for your comment. I think the name of the server can be anything. But to get it starting for web services, it has to begin with MicrosoftDynamicsNAVWS. The problems I had was to get it to start listening to http and not net.tcp. That's when the name is important.

  • Nice Blog....very helpful.....especially "type= share" for Web Services...

  • nice and clear blog, however I have a problem.

    Before I start any of the second services I can see 1 Microsoft.Dynamics.Nav.Server.exe program running in the task manager which is the current live server.

    When I start my second server service everything looks fine i.e. I can see 2 Microsoft.Dynamics.Nav.Server.exe programs running.

    When I start the second WS service I can see 3 Microsoft.Dynamics.Nav.Server.exe  .. surely something is wrong here?

    Does the initial LIVE service need to be renamed to have a $Svr1 to avoid this?

  • Great post thanks so much for sharing all the information, I am looking for more updates.

  • Hi,

    Thanks for this post very helpful.

    i have a problem with calling nav webservice in 3 tiers architecture from a remote session.

    My nav web service is under domain account.

    when i try to call nav web service with soapui i have this message

    Fri Jul 11 12:37:06 CEST 2014:INFO:frcp00vpp1322:7047 requires authentication with the realm 'null'

    RTC work fine in 3 tiers architecture.

    i use proxy fiddler and it work , because fiddler can read kerberos tickets without problem.

    i must call my webservice with soapui.

    Have you any idea please?

    Thanks

  • Hi Gad,

    Hard to say. With 3-tier then the root of a problem could be in lots of places in AD. But try the easy thing first: Enable "Use NTLM Authentication". CustomSettings.config:

    <add key="ServicesUseNTLMAuthentication" value="True" />

    If RTC works well, then there is a chance that this is all you need to do.

    I hope that helps!

    Lars

Page 1 of 1 (14 items)