Hello All,
I am using ArcGIS Server 10.2.2 default printing service gp service but it is not working for secured services. All the services are secured using ArcGIS Builtin security model and i am also using proxy page in between to talk to these services but when i am using printing gp service it is not working. what could be the issue. please help.
Thanks
Here i found the solution of this issue
look at the following page:
https://github.com/djarrard/WebmapWrappers#webmap-wrapper-project
It is provided as a workaround for such scenario. The link provides a python file to download along with its project package.
What it does is modifying the webmap JSON prior to executing a print task. It is what's needed in the your scenario (Insert token with printing secured services when the application uses a proxy page).
However, just like Jim mentioned in post, the username and password to ArcGIS Server are configured explicitly, but this time configured within the python script.
Hope this will be helpfull for lot of developers working on version 10.2.2
Saurabh
The customized python/github solution does work with both 10.2.2 and 10.3, but I thought I would add my two cents as I had the same issues too. Overall, the application and the Print Service should be thought of as completely separate items. The application can use the current Esri proxy for (short) tokens, or you can use a long token embed into application. Either will work.
As for the Print Service, neither will work from the application if map services are secured (although access to the print service can be done both ways). The Esri Proxy short token includes a referer. However, the Print Service will make a new map request itself (based on the JSON strings already shown), but the Print Service doesn't include a referer with its request to the map service (assuming it's also secure). The map service will reject the token since there is no referer even if included in JSON unless you specifically create the token without a referer (or user enters the user/pw at prompt).
You can use the help documentation for the "Long token approach" for the print service (embeds credentials in the Print service) while still using Esri proxy short tokens for map and print service connection. But the short token via Proxy doesn't work once the print service tries to create its own map - although I just heard from support that my enhancement request was accepted to make this more clear in the help
Here is an article that goes more in-depth on this (yes, full disclaimer I wrote it - but easier to refer to it than retype): http://www.spatialtimes.com/2015/04/printing-with-arcgis-for-server-10-3/
Hope it can help.
Here is what I post to my secure printing service through a proxy url:
PDF
{"layoutOptions":{"customTextElements":[{"mapTitle":"Map Test"}]},"operationalLayers":[{"url":"http:
//10.1.2.87:6080/arcgis/rest/services/water-resources/utility_basemap_manual_layers/MapServer","visibility"
:true,"visibleLayers":[0,12,21,24,25,26,27,28,29,30,31,32,33,34,35,36]},null],"exportOptions":{"dpi"
:96},"mapOptions":{"extent":{"xmin":393829.38643702905,"ymin":1559480.6243272335,"xmax":621170.6135629709
,"ymax":1730519.3756727665},"scale":"227341.23"}}
pjson
dXTfSB7wlOUezjLVyAoEHm6kkGP0CUgrng77jdKM34ATLGQHyOMx-VpK3w4HxBo0wChP9zAuCdIhLsqvqg5bjA..
<A class="jive-link-external-small" href="http://10.1.2.87:6080/arcgis/rest/services/secure-print-services/SecureBOCCLandscapeTemplate/GPServer" rel="nofollow noopener noreferrer" target="_blank">http://10.1.2.87:6080/arcgis/rest/services/secure-print-services/SecureBOCCLandscapeTemplate/GPServer</A>
/Export Web Map/execute
It appears to be a problem with both the proxy url and the fact that I do not see the token being passed to the gp service. Whenever you use a secured service, you have to pass the token to the GP service.
Hi Jim,
Thanks for your quick reposne!!
I am publishing my print service using same method you have provided and as given in below url but no sucess
ArcGIS Help (10.2, 10.2.1, and 10.2.2)
I tried looking into my JSON string and i find that it is not prepending the proxy url against map services, is that the issue? Because when i manually put proxy url as a prefix , gp seems to returning blank pdf?
{"exportOptions":{"dpi":96},"mapOptions":{"extent":{"xmax":19154.03163255061,"ymin":43083.54582798357,"xmin":15539.81607078615,"ymax":43964.610090112095,"spatialReference":{"wkid":3414}}},"layoutOptions":{"titleText":"er","copyrightText":"Copyright ©2015 Public Utilities Board (PUB). All rights reserved.","authorText":"GERI","legendOptions":{"operationalLayers":[{"id":"BWAS"},{"id":"BQ Polygon"},{"id":"BQ Segment"},{"id":"HDB Dwellings & Water Efficiency"}]}},"operationalLayers":[{"id":"Street View","maxScale":250,"title":"Street View","url":"http://gisdevqa1/egisqa/rest/services/GERI_Geospace/streetdirectorycache/MapServer","minScale":250000},{"id":"Water Property Critical","visibleLayers":[0],"maxScale":0,"title":"Water Property Critical","url":"http://gisdevqa1/egisqa/rest/services/GERI_WSN/wsnwaterpropertycritical/MapServer","minScale":0}]}
Please help!!
Regards
In ArcCatalog, copy the "Export Web Map" tool and paste in a new toolbox with a name like "Secure Printing". Right-click on the copied tool and select "Edit". Click the "Add" (the plus sign) and choose an ArcGIS Server connection that has the rights / privileges to the secure service you're wanting to print from. Click "OK". Now, run the tool and leave the "Web Map as JSON" blank, select your template and layout (if you want). When the tool is completed, in the "Geoprocessing Results" window, right-click the "Export Web Map" result and choose "Share As" --> Geoprocessing Service. When you're finished uploading that service, it can now be used to print from the secured web map / service.
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.