ArcGIS Server Version: 10.4.0 ArcGIS JS API: 3.25 ArcGIS Desktop: 10.2.1 Browser: IE 11
In my web application, I am consuming secured services and have a requirement to print the map contents.
Initially, the token expiry was set to default (i.e. 60 mins) and everything worked fine including printing, using the Utilities/PrintingTools GP Service.
As part of the requirement, the token expiry was increased from 60 mins to 240 mins - everything still worked fine except for printing! Looking up the esri help it was clear I had to create a custom service. I created the custom service as described in the help documents, but it still fails with the following error:
Error executing tool. Export Web Map Task Job ID: jb88972125ace4b6593c8055ee779e920 : Layer "dynLyrId": Unable to connect to map server at https://server.domain:6443/arcgis/rest/services/WebViewer/MapServer/. Failed to execute (Export Web Map). Failed to execute (Export Web Map Task).
The custom service has a user connection (with saved credentials) embedded into it as required.
Upon investigating further, I found out that if I remove the token from the WebMapAsJson, it works like a charm (in ArcCatalog at least)!
I don't know how to do that as I am not creating the WebMapAsJson manually, but the esri JS API creates it while sending the request. I also tried to increase the ArcGIS Servers' shortTimeout value from 60 to 240 but even that failed.
Any ideas to make the printing work with long-validity tokens?