<?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: Printing using secured Services in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/printing-using-secured-services/m-p/356968#M2293</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got a solution &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;P&gt;This case is if you need to use long lived tokens like I do.&lt;/P&gt;&lt;P&gt;1. Publish your custom print gp service tool as directed though the following link &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000005q3000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000005q3000000"&gt;ArcGIS Help 10.1&lt;/A&gt; .&lt;/P&gt;&lt;P&gt;2. The using the PrintParamters class in the API generate a JSON object of the print Parameters using the "toJSON" method on the class. This will return the layout format, template and Web_Map_JSON.&lt;/P&gt;&lt;P&gt;3. Loop through the web_map_json.oprationalLayers array and remove the "web_map_json.oprationalLayers&lt;I&gt;.token" property from all the layers that have them.&lt;/I&gt;&lt;/P&gt;&lt;P&gt;4. Then use the GeoProcessor class to execute the print parameters by passing in the object returned from the .toJSON method on the printParameters class.&lt;/P&gt;&lt;P&gt;5. And your should get a print out. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jun 2015 07:54:37 GMT</pubDate>
    <dc:creator>NigelDsouza</dc:creator>
    <dc:date>2015-06-16T07:54:37Z</dc:date>
    <item>
      <title>Printing using secured Services</title>
      <link>https://community.esri.com/t5/developers-questions/printing-using-secured-services/m-p/356967#M2292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;I have two Map services which are secured using a http referrer token. I have published a print tool as per the help tutorial at&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000005q3000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000005q3000000"&gt;ArcGIS Help 10.1&lt;/A&gt; yet my print tool does not seem to work. The server log displays an error like&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #505051; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; background-color: #e5edf4;"&gt;&lt;SPAN&gt;Layer "&amp;lt;Test&amp;gt;": Unable to connect to map server at &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://geonet.esri.com/" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;server&amp;gt;/arcgis/rest/services/&amp;lt;servcename&amp;gt;/MapServer. Failed to execute (ExportWebMap). Failed to execute (Export Web Map).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However if I alter the services from "private" to "public" i.e remove the token then the tool prints out the map.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #505051; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; background-color: #e5edf4;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #505051; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; background-color: #e5edf4;"&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #505051; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; background-color: #e5edf4;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: I have to achieve this using a token generated by the http referrer option only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone provide me a solution or a workaround to the same?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nigel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2015 08:50:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/printing-using-secured-services/m-p/356967#M2292</guid>
      <dc:creator>NigelDsouza</dc:creator>
      <dc:date>2015-06-03T08:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Printing using secured Services</title>
      <link>https://community.esri.com/t5/developers-questions/printing-using-secured-services/m-p/356968#M2293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got a solution &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;P&gt;This case is if you need to use long lived tokens like I do.&lt;/P&gt;&lt;P&gt;1. Publish your custom print gp service tool as directed though the following link &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000005q3000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000005q3000000"&gt;ArcGIS Help 10.1&lt;/A&gt; .&lt;/P&gt;&lt;P&gt;2. The using the PrintParamters class in the API generate a JSON object of the print Parameters using the "toJSON" method on the class. This will return the layout format, template and Web_Map_JSON.&lt;/P&gt;&lt;P&gt;3. Loop through the web_map_json.oprationalLayers array and remove the "web_map_json.oprationalLayers&lt;I&gt;.token" property from all the layers that have them.&lt;/I&gt;&lt;/P&gt;&lt;P&gt;4. Then use the GeoProcessor class to execute the print parameters by passing in the object returned from the .toJSON method on the printParameters class.&lt;/P&gt;&lt;P&gt;5. And your should get a print out. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2015 07:54:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/printing-using-secured-services/m-p/356968#M2293</guid>
      <dc:creator>NigelDsouza</dc:creator>
      <dc:date>2015-06-16T07:54:37Z</dc:date>
    </item>
  </channel>
</rss>

