I need to extract the document location of a published web service. Is there any way this can be accomplished in python? I know where the maps are sitting on the server, and i know the name of the service and what mxd file they're based on, but i need to accomplish this programatically.
-
Do you refer to the source .mxd document you had open in ArcMap when publishing? If yes, this information is not maintained because the .mxd is copied to the server folder and no link to the source .mxd is maintained, so you cannot figure out which one you've used for publishing.– Alex TereshenkovCommented Mar 5, 2014 at 6:53
3 Answers
Unfortunately no. As Alex said, there is no real link between the original published mxd and the service (although there was in previous versions). You can however find a copy of the published mxd on your server in your ArcGIS Server directory at %arcgisserver root%\directories\arcgissystem\arcgisinput\%service folder name%\%service name%.MapServer\extracted\v101
-
Thanks Nate, that will at least give me a work around. I tried to extract the source mxd from the manifest.xml in the extracted folder, but that was not the most elegant solution. Commented Mar 5, 2014 at 14:26
You might also look in:
%arcgisserver root%\directories\arcgissystem\arcgisinput\%service folder name%\%service name%.MapServer\
There is a manifest and in that there is "onPremiseConnectionString".
This might help you track down some info as it will have the location of the DB connection string that was used.
...
https://developers.arcgis.com/rest/enterprise-administration/server/servicemanifest.htm
You're looking for "resources" --> "onPremisePath" which should give you a record of the original MXD file path.