Create Service with Capabilities

1111
5
Jump to solution
12-19-2012 04:07 AM
GreggCountryman
New Contributor
Hello,

I have written a python script to create a map service. The bulk of the script is three commands basically to verify the map document, create a service definition file, and then publish. The script works fine, except that it does not set the capabilities. For example, in one service, I would like to turn off KML, and turn on Network Analyst. I searched but could not find out how to do this. Here is the code:

analysis = arcpy.mapping.CreateMapSDDraft(mapDoc, sddraft, service, 'ARCGIS_SERVER', con, True, None, summary, tags)
result = arcpy.StageService_server(sddraft, sd)
result = arcpy.UploadServiceDefinition_server(sd, con)

Thanks,

Gregg
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JeffMoulds
Esri Contributor
In order to enable/disable capabilities, you have to use Python to modify the XML structure of the .sddraft. There are examples here: http://resourcesdev.arcgis.com/en/help/main/10.1/index.html#/CreateMapSDDraft/00s30000006q000000/

Look at Modify SDDraft example 3 and 4.

View solution in original post

5 Replies
JeffMoulds
Esri Contributor
In order to enable/disable capabilities, you have to use Python to modify the XML structure of the .sddraft. There are examples here: http://resourcesdev.arcgis.com/en/help/main/10.1/index.html#/CreateMapSDDraft/00s30000006q000000/

Look at Modify SDDraft example 3 and 4.
AnnStark
New Contributor II
Is the .sddraft XML schema published somewhere.  How does one know what the possible choices are when modifying the XML to fit one's needs?
0 Kudos
CarmaGerber
New Contributor
In order to enable/disable capabilities, you have to use Python to modify the XML structure of the .sddraft. There are examples here: http://resourcesdev.arcgis.com/en/help/main/10.1/index.html#/CreateMapSDDraft/00s30000006q000000/

Look at Modify SDDraft example 3 and 4.


Hi Jeff

I am currently trying to access this link however it's not working at the moment. I am also trying to modify an .sddraft file and would like to use an xml tile cache schema file to update the caching details of the .sddraft. Would you have an updated url?

Many thanks in advance,

Regards,
Carma
0 Kudos
CarmaGerber
New Contributor
Thanks Matt,

I've just realised this is the Help document I have been reading for the past few days. I have used it to work out how to update the cache status of an .sddraft however it doesn't go further in updating the tiling scheme which is now what I need to do.

Thanks for the response!

Regards
Carma Gerber
0 Kudos