Select to view content in your preferred language

token based security and 10.1 printing gp service

8637
25
09-21-2012 07:13 AM
Drew
by
Regular Contributor
Has anyone successfully produced a print when using a secured service?

I am getting the following error..

Error executing tool.: Layer "ArcGISDynamicMapServiceLayer405": Unable to connect to map server at    [...Web map URL with token written here......] Failed to execute (ExportWebMap). Failed to execute (Export Web Map)




Is there something I need to configure?

Drew
Tags (2)
25 Replies
MayJeff
Occasional Contributor
Samething on ArcGIS Flex viewer and Application builder on Print Widget.
0 Kudos
DasaPaddock
Esri Regular Contributor
- send via HTTP and POST using the REST API because there is no PrintParamaters.fromJSON yet 🙂


You can use a Geoprocessor for this step. That's actually what the PrintTask uses:

_gp.execute(printParameters.toJSON(), responder);
0 Kudos
DasaPaddock
Esri Regular Contributor
Thanks for replying my thread.  At least I am not the only one having this problem now. Would you please keep me update if you able to get it to works.  I really appreciated that.  Do you think have to do anything on the proxy file too?  I run all my secured map services on 10.1 and everything is working find except the printTask.   I also run a esri high-quality printing simple code (https://developers.arcgis.com/en/flex/sample-code/printtask.htm) then change url & secure gp sevices to my own services and get the same message. Really spending alot of time on it and didn't find any documents or ways from ESRI team.  Just wonder is it a PrintTask bug on 10.1 or not many people using this function at all?


Are you using long term tokens (tokens that are restricted to an ip or referer)? If not, then you probably need a different solution. You may need to work with Esri Support.
0 Kudos
weeyeo
by
New Contributor II
I am not using long term token and just asked ESRI support for this problem.
You mentioned this on your previous post "If this is not an option for you, you could call PrintParameters.toJSON() and then remove the token from the url in the JSON. You'd then need to use a Geoprocessor to call your print service with the modified JSON"

Can you show me how do you get the code to work on print task widget?  I would like to give this a try too.

Really appreciate your help.

Thanks.
0 Kudos
DasaPaddock
Esri Regular Contributor
I am not using long term token and just asked ESRI support for this problem.
You mentioned this on your previous post "If this is not an option for you, you could call PrintParameters.toJSON() and then remove the token from the url in the JSON. You'd then need to use a Geoprocessor to call your print service with the modified JSON"

Can you show me how do you get the code to work on print task widget?  I would like to give this a try too.

Really appreciate your help.

Thanks.


If you're using short term tokens, like the ones generated by IdentityManager, then you don't need to remove them from the URLs in the print JSON. Short term tokens are not restricted to an IP or referer so they should work when passed through the print service.
0 Kudos
HeatherGonzago
Esri Contributor
Not sure if the problem is only occuring when trying to print the individual feature layer from the print task? If so, than that does appear to be an issue with 10.1. I cannot reproduce it using 10.2. It is not specific to Flex but rather on the server-end itself.
0 Kudos
weeyeo
by
New Contributor II
I found out if you try to print Feature Layer on 10.1, it won't print it too.  So upgrade to 10.2 will help solve this problem?  My temporary solution is removed Feature Layer before send it to print.

Thank you.
0 Kudos
HeatherGonzago
Esri Contributor
After further testing, the problem with printing secure feature layers (NOT the dynamic service itself) from a secured print task appears to also occur in 10.2. This has been logged as NIM094431.

Thanks.
0 Kudos
DrewDowling
Occasional Contributor III
Adding my experience with this in case it helps anyone or anyone knows of a workaround

running ArcGIS Server 10.1
Flexview app using a secured dynamic service.
Unsecured print service

When a long lived token for the dynamic layer is added to the flex viewer config.xml the print service does not work. Error message is: Error executing tool.: Layer "Map Features": Unable to connect to map server at http://<server>:6080/arcgis/rest/services/Secured/FIRM/MapServer?token=KrGwxThrMRtL-K9O6kCnJggy1qSe3EAdyTCMtIxsPFxto6eSj..........

When no token is added to the config file and a user is forced to log in when the app loads then printing occurs normally.
0 Kudos
UldisGitendorfs
New Contributor II
Hi!
I know there are some months gone since the last answer, but I would like to give my five cents in this.
ArcGIS 10.2.1 printing secure services everything is just like in Help - http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000005q3000000
but some things to mention is - when creating connection in ArcCatalog you should write ArcGIS Server url to web adaptor not that with the 6080 port. Of course if you are using Web adaptor.
And one other thing - PrintService should run in Synchronous mode and for WebApp the url for print task should be taken from rest directory.

All I mentioned above were those thingies giving errors in my project.
0 Kudos