Hi
I wonder if anyone has a tool or a method that creates service definition files form a folder that contains multiple mxd files.
In my case I have a folder that has 76 mxds and I want to create 76 sd files in another folder from the existing mxd.
Thanks,
Ahmad Saleh
Solved! Go to Solution.
There are a few samples on the help site for scripting publishing using Python. The general idea is that you would use a for loop with the list of contents of the folder using os.listdir, figure out which are .mxds, and use Stage Service and Upload Service Definition to publish them. You can use the name of the mxd for the name of the service.
Although I haven't tried this out, CreateMapSDDraft - ArcPy
You might create a list to do it for every MXD in a particular workspace.
Thanks Jayanta,
I have tried this before, the main issue with it the code is name dependent, for every sd that you need to create you should add the service name and workspace! I want a smarter tool or code that iterates all mxd in the file and create sd file.
In the link that you provided I should copy every mxd name to the code.
Thanks,
Ahmad Saleh
Maybe we should wait for a response from our Python experts to tweak the CreateMapSDDraft (adding wildcards maybe) alongwith the addition of Stage Service tool.
There are a few samples on the help site for scripting publishing using Python. The general idea is that you would use a for loop with the list of contents of the folder using os.listdir, figure out which are .mxds, and use Stage Service and Upload Service Definition to publish them. You can use the name of the mxd for the name of the service.