Select to view content in your preferred language

Update map service title using Python

1387
4
Jump to solution
05-15-2013 10:32 AM
BradPosthumus
Frequent Contributor
I need to update the title of a map service programmatically. The title is normally set in the MXD's map document properties (see http://resources.arcgis.com/en/help/main/10.1/index.html#//006600000444000000) but I need to do it after it's been published to AGS.

I can get the JSON response for the service using the code here:

http://resources.arcgis.com/en/help/main/10.1/index.html#/Example_Edit_service_properties/0154000005...

...but there doesn't appear to be any service properties that include the title. Is this possible with arcpy?

(When looking at the rest endpoint of the service, the section I need to update is this one:

Document Info:


    Title:
    Author:
    Comments:
    Subject:
    Category:
    Keywords:
    AntialiasingMode: None
    TextAntialiasingMode: Force
)
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AlexeyTereshenkov
Deactivated User
Brad, I am not 100% sure about this, but it might be that you would have to update the title in the .mxd document and republish the map service by overwriting an existing one to get the title updated. I can't see any other way to get hands at the Title under the Document Info section.

In the parameters list of the Service, there is no Title or anything close to that...
http://resources.arcgis.com/en/help/server-admin-api/createService.html#params

View solution in original post

0 Kudos
4 Replies
AlexeyTereshenkov
Deactivated User
Brad, I am not 100% sure about this, but it might be that you would have to update the title in the .mxd document and republish the map service by overwriting an existing one to get the title updated. I can't see any other way to get hands at the Title under the Document Info section.

In the parameters list of the Service, there is no Title or anything close to that...
http://resources.arcgis.com/en/help/server-admin-api/createService.html#params
0 Kudos
BradPosthumus
Frequent Contributor
Thanks for responding.

My problem is there isn't an MXD to begin with. Using Python I'm creating a geoprocessing service  (using arcpy.CreateGPSDDraft) that has a result map service tied to it. Since you can't set any metadata for a result map service when you create it, I was hoping to add it in after. The Title was an important one since our application reads this in for display to the end-user. If it can't find the title then it displays the service name, so we ended up making the service name a bit more readable (which is difficult to do when you can't use spaces).
0 Kudos
AlexeyTereshenkov
Deactivated User
I see. Well, I guess that's the best plausible solution to the challenge you have...
0 Kudos
AlexeyTereshenkov
Deactivated User
Brad, have found myself recently that one can update the title of a map service within your ArcGIS Server connection in the Catalog window. Right-click the service and choose Item Description. Then update the Title. However, this seems not to update the Title found in the Document Info section you are interested in. This updates the Title found under http://server:6080/arcgis/rest/services/service/MapServer/info/iteminfo. If you could access this title instead, this would be a good workaround.
0 Kudos