How do I find out if a map service has a dynamic workspace attached using the REST API?

843
2
01-04-2017 05:20 PM
ChristopherMugdan
New Contributor III

If not, is there another way to do this programmatically? I would much prefer to be able to use the REST interface as I am using that for all my other requests

0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Christopher,

Not sure if there is a way to do this using the REST API, but here is an example using python to query the serviceconfiguration.json file that is created with the service:

import json

with open(r"D:\arcgisserver\directories\arcgissystem\arcgisinput\Airports.MapServer\extracted\serviceconfiguration.json") as datafile:
        data = json.loads(datafile.read())
datafile.close()

print data['service']['properties']['dynamicDataWorkspaces']‍‍‍‍‍‍‍

This will return:

[{"id":"MyFileGDBWorkspaceID","workspaceFactory":"FileGDB","workspaceConnection":"DATABASE=D:\\Temp\\Python\\Test.gdb"}]
ChristopherMugdan
New Contributor III

Thanks for you reply Jake.

I had a look at the JSON and I can see the setting in properties. Unfortunately I cannot readily get this information. Currently, my application uses the ArcGIS REST API to render map images using the Print Tools ExportWebMap and I want to use the Export Map facility in the map services because it is quicker and more flexible (and less buggy;-). I need to use dynamic workspaces for this so I need to know in advance whether a map service has a dynamic workspace in it.If the service does not have a suitable dynamic workspace then I revert to my current method of rendering the map image.

Maybe the best way is to send a test "dummy" request to the service when I get its information and check the response? It is just a bit of a nuisance!

Cheers,
Chris

0 Kudos