<?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: ConvertWebMapToMapDocument Python Script With Secure Map Services in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417968#M32826</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok it's something to do with the token as it works fine if I enter the credentials into IdentityManager (this is for a flex application), but just doesn't work with a token attached to the map service.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Mar 2013 06:00:13 GMT</pubDate>
    <dc:creator>ShaunWeston</dc:creator>
    <dc:date>2013-03-28T06:00:13Z</dc:date>
    <item>
      <title>ConvertWebMapToMapDocument Python Script With Secure Map Services</title>
      <link>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417964#M32822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've developed a python script for use in a web application, which works fine for public services, but does not work with secure services. I've setup some code in the script to hopefully handle secure services:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;serverConnection is a variable, which holds the path to a user connection to the arcgis server&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
server = {}
server['SERVER_CONNECTION_FILE'] = serverConnection
result = arcpy.mapping.ConvertWebMapToMapDocument(webmapJSON, templateMxd, extra_conversion_options=server)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I can publish it to server and print public map services, but secure services come back with this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #4D4D4D; font-family: Tahoma;"&gt;Unable to connect to map server at&amp;nbsp; ..."},{"type":"esriJobMessageTypeInformative","description":"Layer \"Licences\": Unable to connect to map server at &lt;/SPAN&gt;&lt;A href="http://gis.mstn.govt.nz/arcgis/rest/services/RegulatoryAndInspection/Licences/MapServer?token=I-eon3AsL00-hfH4H74iiWQ1t25ARRnpJrofyxvdiaG3ozl_ZXVwc9wBPozzFply8bS9AXyCFrikUZQ6nWW5_w..." rel="nofollow noopener noreferrer" target="_blank"&gt;http://gis.mstn.govt.nz/arcgis/rest/services/RegulatoryAndInspection/Licences/MapServer?token=I-eon3AsL00-hfH4H74iiWQ1t25ARRnpJrofyxvdiaG3ozl_ZXVwc9wBPozzFply8bS9AXyCFrikUZQ6nWW5_w..."},{"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;S&lt;/A&gt;&lt;SPAN&gt;o I've setup the tokens to pass in a flex app and the tokens are HTTP Referrer (in fact I've tried lots of different token options but nothing works!). Why does it have this error?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:54:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417964#M32822</guid>
      <dc:creator>ShaunWeston</dc:creator>
      <dc:date>2021-12-11T18:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: ConvertWebMapToMapDocument Python Script With Secure Map Services</title>
      <link>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417965#M32823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;is serverConnection file accessible to local user arcgis of ags?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 12:53:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417965#M32823</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2013-03-26T12:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: ConvertWebMapToMapDocument Python Script With Secure Map Services</title>
      <link>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417966#M32824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Check out the sample in the extra_conversion_options parameter help in the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/#/ConvertWebMapToMapDocument/00s30000006n000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;ConvertWebMapToMapDocument&lt;/A&gt;&lt;SPAN&gt; help topic. You'll want something like this:&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;dict = {"SERVER_CONNECTION_FILE":r"Z:\share\ArcGIS2 on MyServer (user).ags"}
result = arcpy.mapping.ConvertWebMapToMapDocument(json, extra_conversion_options=dict)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some things to check:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Open the connection file in the catalog window in ArcMap and make sure you can see the secure service without being prompted for credentials.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Make sure the connection file has "save username and password" checked on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- If you are testing this as a GP service, make sure the server can see the path to the connection file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:54:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417966#M32824</guid>
      <dc:creator>JeffMoulds</dc:creator>
      <dc:date>2021-12-11T18:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: ConvertWebMapToMapDocument Python Script With Secure Map Services</title>
      <link>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417967#M32825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've tried all those suggestions and nothing works it just always shows the Unable to connect to map server error when I look in fiddler. I don't understand what the issue is the arcgis account can definitely see it and I'm using the administrator login/password, which is saved and can see the secured service when I look through ArcCatalog.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 03:10:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417967#M32825</guid>
      <dc:creator>ShaunWeston</dc:creator>
      <dc:date>2013-03-28T03:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: ConvertWebMapToMapDocument Python Script With Secure Map Services</title>
      <link>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417968#M32826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok it's something to do with the token as it works fine if I enter the credentials into IdentityManager (this is for a flex application), but just doesn't work with a token attached to the map service.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 06:00:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417968#M32826</guid>
      <dc:creator>ShaunWeston</dc:creator>
      <dc:date>2013-03-28T06:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: ConvertWebMapToMapDocument Python Script With Secure Map Services</title>
      <link>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417969#M32827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;just checking - did you try what is mentioned in this help topic? &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/#/Printing_maps_that_contain_secured_services/0154000005q3000000/"&gt;http://resources.arcgis.com/en/help/main/10.1/#/Printing_maps_that_contain_secured_services/0154000005q3000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 23:08:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417969#M32827</guid>
      <dc:creator>TanuHoque</dc:creator>
      <dc:date>2013-03-28T23:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: ConvertWebMapToMapDocument Python Script With Secure Map Services</title>
      <link>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417970#M32828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you able to add secured services to your python script? Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 18:40:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convertwebmaptomapdocument-python-script-with/m-p/417970#M32828</guid>
      <dc:creator>MayJeff</dc:creator>
      <dc:date>2013-11-06T18:40:23Z</dc:date>
    </item>
  </channel>
</rss>

