Select to view content in your preferred language

Single LocalMapService instance

2443
7
01-01-2013 05:58 AM
Labels (1)
StéphaneVouillamoz
Emerging Contributor
Hello,

I have an WPF application displaying a simple map which always uses the same mpk but is passed as an argument the map extent.
Several instances of this application can run concurrently with different map extents but they all instantiate their own LocalMapService.
Is there a way to ensure there is only one service running for all application instances when one instance is already running to save the precious seconds it takes to launch the service ?

Thanks for any hints

La vouillas
0 Kudos
7 Replies
AnttiKajanus1
Deactivated User
Hi,

For my knowledge, you cannot share local services between the application instances. Every application has it's own Local Server instance and services running that is restricted and secured only for that application. What you can and should do is to create functionality to kick services up on background and visualize the loading accordingly. You can find some starters for that from SDK samples and Local Server / Local Server / Local Server Management example.

Hope it helps.
0 Kudos
StéphaneVouillamoz
Emerging Contributor
Thanks for your answer.

I finally made it work. I'm starting a local map service in a console application using LocalMapService and store the random URL in a database. Then I'm starting a WPF client reading the URL from the database and using  ArcGISDynamicMapServiceLayer (not ArcGISLocalDynamicMapServiceLayer) for instance to connect to the REST local service provided by the console application. I can launch as many WPF clients as I want. I no longer have the penalty of waiting for the server to start then.

Bottom line is that you  need to pass on the random URL used by the Server to the Client. I used a database as it was available in my application but they are many ways. Of course, you have to deal with inter process synchronization as well as the client has to wait for the service to be ready. I used EventWaitHandle class to achieve it.

Cheers
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

#. RE: Random URL:- note that you can disable the random prefix by using the LocalServerUtility tool in the Start Menu.

#. RE: Multiple application instances:- Are these mutliple instances of the sample application? Or different applications? If they are different applications you will need to license each one separately. The ArcGIS Runtime licensing is per application, not per machine.

Cheers

Mike
0 Kudos
StéphaneVouillamoz
Emerging Contributor
There are several instances of the same application zooming on different extents. They all use the same server application.
The penalty of starting the server is only on the first instance.

Thanks

Vouillas
0 Kudos
BrianRassier
Deactivated User
Hi Mike �??

Starting local services outside of our primary application is something we�??re also considering.  We want to reduce our startup speed as much as possible.

You mention the ability to disable the random prefix using the LocalServer Utility tool.  Is that something you�??d recommend on a production/client environment?  Would that put us in any sort of debug mode (like the HTTP Traffic setting in that LocalServer Utility)?

Thanks!
-Brian
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

Disabling the random prefix in the LocalServerUtility (or config file) does not introduce any other debugging activity but what it does mean is any application on the deployment machine could more easily find and interact with the RuntimeLocalServer instance by simply requesting the main url and trying different port numbers until it got the correct response. For this reason we added the random prefix to provide an additional level of security. However, this scenario would entail another application actively/maliciously looking for that URL to exploit. Whether you consider that a security risk is really up to you.

Cheers

Mike
0 Kudos
BrianRassier
Deactivated User
Thanks Mike!  That insight helps our team a lot.

-Brian
0 Kudos