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)
The bug that Drew mentioned applies to me. We are on 10.1. Here is what I've got and how I got around it.
I have a map service and a custom print service within a secured folder. I am able to print the map if I print the entire dynamic map service. I can even set the visibleLayers property to hide some layers. As soon as I try to print an individual feature layer from this map, it doesn't work. I have tried the exact same thing on an unsecured map service and it works as expected.
I wanted to print an individual feature layer so I could set the selectionObjectIds property in my webmap JSON to highlight a particular feature. As a work around, I added a graphics layer to the webmap JSON. I grabbed the selected feature's geometry and used that to define the graphics layer.
We can't upgrade beyond 10.1 just yet. Hopefully this helps someone.
This helped thanks .
Here is the esri source code
Esri/resource-proxy · GitHub
download your preferred language and then install as a web app on oyur web server.
Next play around with the proxy.config settings until they are right for your environment. e.g.
<ProxyConfig allowedReferers="*" mustMatch="false"> <serverUrls> <!--<serverUrl url="http://services.arcgisonline.com" matchAll="true"/>--> <serverUrl url="http://MyWebServer:6080/arcgis/rest/services" username="MyID" password="MyPass" rateLimit="600" rateLimitPeriod="60" matchAll="true"> </serverUrl> </serverUrls> </ProxyConfig>
You might need to/probably should lock down what is available through the proxy. There are instructions on how to do this in the readme.txt
I have the exact same issue with print task in javascript API. Could you let me know how do you setup proxy for print service? Thanks!
Hi Drew,What do you mean by : "using a proxy page instead of using a token directly "?I use a proxy too in order to avoid typing the user & password but I cannot print any map with secured layers.Have you succeeded?Thanks,Miri
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.
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?
- send via HTTP and POST using the REST API because there is no PrintParamaters.fromJSON yet 🙂
Can you show me how do you write a code to perform this task? I had created a new secured print service for my gp service. Thank you.
How is the token being generated? Is it restricted by referer or ip address?
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
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.