simon.law

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

Discussion created by simon.law on Feb 7, 2013
Latest reply on Jan 6, 2014 by JGravois-esristaff
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!

Outcomes