<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Update map service server paths in MXD in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/update-map-service-server-paths-in-mxd/m-p/270297#M20841</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It seems you're correct.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Help references you've included do not explicitly say anything regarding exceptions being ArcGIS Server map service paths, which would be helpful if they did explicitly mention it, but those references do seem to list what constitutes a viable workspace for function input and map service is not to be found in the list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I appreciate the reply!&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If there is an automated method that will work for this, then its development is probably going to require more time than I can spare right now. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lee&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Oct 2013 18:41:46 GMT</pubDate>
    <dc:creator>LeeBrannon</dc:creator>
    <dc:date>2013-10-03T18:41:46Z</dc:date>
    <item>
      <title>Update map service server paths in MXD</title>
      <link>https://community.esri.com/t5/python-questions/update-map-service-server-paths-in-mxd/m-p/270295#M20839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an mxd (10.1) with roughly 15 map services added in as layers in the map. These map services are from our in-house ArcGIS Server (10.1). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to update the server path on each map service link in the mxd so they will display on the map - this is because we lost a server port and need to use our other server port (both ports are (were) setup on our ArcGIS Server to allow map service consumption by clients). This seemed like a good use of arcpy.mapping scripting so I tried to use&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;mxd.findAndReplaceWorkspacePaths(OLDfolderPath, NEWfolderPath)&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to accomplish this task. No luck. No error returned, just no update to the map service server paths in the mxd. Should the function above work in this situation or is there another function I should be using to automate this task?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;** See attached Python script&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Lee&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 15:23:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-map-service-server-paths-in-mxd/m-p/270295#M20839</guid>
      <dc:creator>LeeBrannon</dc:creator>
      <dc:date>2013-10-02T15:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Update map service server paths in MXD</title>
      <link>https://community.esri.com/t5/python-questions/update-map-service-server-paths-in-mxd/m-p/270296#M20840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm pretty sure you can not change mapservice datasource with arcpy unfortunately. I can't find a specific post or documentation that explicitly says it but I remember I voted for someone suggesting the idea on &lt;/SPAN&gt;&lt;A href="http://ideas.arcgis.com"&gt;http://ideas.arcgis.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can not use arcpy.mapping replaceWorkspaces, ArcGIS Server is not part of the "replaceable" workspace. &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/fr/help/main/10.1/index.html#//00s30000000n000000"&gt;Here&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A mapservice can be list as a layer in a map document using : for layer in arcpy.mapping.ListLayers()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then it has the property : layer.isServiceLayer = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So you can access to its : layer.serviceProperties with the information about ArcGIS Server connection properties.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/fr/help/main/10.1/index.html#//00s300000008000000"&gt;serviceProperties&lt;/A&gt;&lt;SPAN&gt; are read only... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I'm right, this limitation should definitively appear &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//006m0000006q000000"&gt;and here&lt;/A&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/fr/help/main/10.1/index.html#//00s30000004p000000"&gt;here&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dear Esri, can we have further information about it ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 21:20:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-map-service-server-paths-in-mxd/m-p/270296#M20840</guid>
      <dc:creator>SchoppMatthieu</dc:creator>
      <dc:date>2013-10-02T21:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Update map service server paths in MXD</title>
      <link>https://community.esri.com/t5/python-questions/update-map-service-server-paths-in-mxd/m-p/270297#M20841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It seems you're correct.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Help references you've included do not explicitly say anything regarding exceptions being ArcGIS Server map service paths, which would be helpful if they did explicitly mention it, but those references do seem to list what constitutes a viable workspace for function input and map service is not to be found in the list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I appreciate the reply!&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If there is an automated method that will work for this, then its development is probably going to require more time than I can spare right now. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lee&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 18:41:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-map-service-server-paths-in-mxd/m-p/270297#M20841</guid>
      <dc:creator>LeeBrannon</dc:creator>
      <dc:date>2013-10-03T18:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Update map service server paths in MXD</title>
      <link>https://community.esri.com/t5/python-questions/update-map-service-server-paths-in-mxd/m-p/270298#M20842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Have you tried creating a layer file that references the service?&amp;nbsp; Then try using arcpy.mapping UpdateLayer or AddLayer followed by RemoveLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2013 14:39:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-map-service-server-paths-in-mxd/m-p/270298#M20842</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2013-10-04T14:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Update map service server paths in MXD</title>
      <link>https://community.esri.com/t5/python-questions/update-map-service-server-paths-in-mxd/m-p/270299#M20843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did happen to see those options (UpateLayer/AddLayer) after my last post, but I have not yet tried to do it that way.&amp;nbsp; Seems like it would work, but I would just have to manually reload each map service, from the functioning server connection, into an mxd and save each as a layer file (which should be scriptable with SaveToLayerFile_management, maybe) , then try UpdateLayer with the new layer files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for getting my mind back on that...I'll try it out and re-post about it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lee&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Oct 2013 22:33:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-map-service-server-paths-in-mxd/m-p/270299#M20843</guid>
      <dc:creator>LeeBrannon</dc:creator>
      <dc:date>2013-10-07T22:33:25Z</dc:date>
    </item>
  </channel>
</rss>

