Select to view content in your preferred language

Export Web Map Task Error: 'unable to connect to map server' only at  the first time

12713
15
02-07-2013 04:58 AM
SimonLeo
Deactivated User
Hi all,

I am developing a web app based on ArcGIS JS API. one simple task is to export map to image. I am using Esri Basemaps. It behaves strangely that always pops up exception at the first time you execute Export_web_map task, then it will work fine in following times. Here, 'the first time' means right after this application is loaded.

The error details:
"Error executing tool.: Layer "layer0": Unable to connect to map server at http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer. Failed to execute (Export Web Map). Failed to execute (Export Web Map Task)."

This case is very similar to one previous post at this forum: Export Web Map Task Error: "Unable to connect to map server...". But that case happens every time user execute export_map task, while in my case it only happens at the first time.

I also have a proxy on web server since this app requires feature_editing functions. part of proxy.config:
<serverUrl url="http://services.arcgisonline.com/ArcGIS/rest/services/" 
               matchAll="true"></serverUrl>
    <serverUrl url="http://sampleserver1.arcgisonline.com/arcgis/rest/services/" 
               matchAll="true"></serverUrl>
    <serverUrl url="http://sampleserver2.arcgisonline.com/arcgis/rest/services/" 
               matchAll="true" 
               token=""></serverUrl>
    <serverUrl url="http://server.arcgisonline.com/arcgis/rest/services/"
               matchAll="true"></serverUrl>
    <serverUrl url="http://orthogonal.esri.com/arcgis/rest/services/"
               matchAll="true"></serverUrl>


I added http://services.arcgisonline.com/ArcGIS/rest/services/ in it, but it still does the same thing.

the proxy is .NET based on IIS7.5

any suggestions will be appreciated!
15 Replies
SimonLeo
Deactivated User
well, Jian! First of all, thank you for your very detailed explanation. It helps a lot understanding those behind-scenes. Even though I am pretty sure I used latest proxy package, to give it another shot, I replaced proxy pages with the ones from new download. We will give it more tests, and I wish this issue will be fixed by doing this (I will get back and accept answer then). Appreciate the help from you guys.

One more thing, this is not just for print service. It happens for any types of service, for example geometry service. If you are trying to reproject a geometry through a geometry service, and the domain of the geometry service has not been accessed before, the same situation will happen. It will send a call to rest info to decide if CORS is supported or not, but the first request to the geometry service will go through proxy since it doesn't know the result yet from the rest info call.
0 Kudos
MikeKillion
Deactivated User
I'm getting the same error message when trying to make a request directly from the REST endpoint, so no proxy involved, right? Get the error even when I'm remoted in to the machine where Server resides.

Any thoughts appreciated.

Mike
0 Kudos
SimonLeo
Deactivated User
Don't know why the issue is still there. Are there any things I should be careful when setting up a proxy on IIS?


One more thing, this is not just for print service. It happens for any types of service, for example geometry service. If you are trying to reproject a geometry through a geometry service, and the domain of the geometry service has not been accessed before, the same situation will happen. It will send a call to rest info to decide if CORS is supported or not, but the first request to the geometry service will go through proxy since it doesn't know the result yet from the rest info call.
0 Kudos
JianHuang
Deactivated User
Mike,

For your case, the reason is the map service is not accessible by the print service. Please make sure the map service is public accessible if the print service is not an internal service.

I'm getting the same error message when trying to make a request directly from the REST endpoint, so no proxy involved, right? Get the error even when I'm remoted in to the machine where Server resides.

Any thoughts appreciated.

Mike
0 Kudos
GaneshSolai_Sambandam
Regular Contributor
Hi GIS folks,
I have created a print widget into my web application on arcgis.com hosted site and it uses the default print service from ARCGIS
"http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%2...";
which works perfectly fine.

When I try use my own print service using Export Web Map task using ARCGIS Server 10.1, I am getting the following error from firebug, "Request timeout exceeded" - Can anyone tell me what might be the reason for this.

Secondly, it loads all the custom templates defined in our print service, and when I click on the layout templates, the button changes to printing, but, nothing happens to show print map in pdf format. - firebug shows post request says that Request timeout exceeded. Please help on this.

Regards
Ganesh
0 Kudos
JohnGravois
Deactivated User
@ganesh,
just a guess, but possibly the operation supported by your actual service (either 'execute' if the service is synchronous and 'submitJob' if asynchronous) doesn't match the operation which is being called from the application itself.

if this is the case, you could set the 'async' property in the options of the Print Widget constructor as appropriate.
0 Kudos