0

I am using the Configurable Javascript Viewer, and have only changed a couple of the configuration settings.

One change I made was to use my own Export Web Map Task.

In viewer.js, I changed:

printTaskURL: 'http://maps.evansvillegis.com/arcgis_server/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task'

I then saw this note in the readme.md in the proxy directory:

You will more than likely need a proxy page for printing and other large cross domain requests.

So, I set that up using the provided proxypage_net.zip files, proxy.ashx and proxy.config.

In proxy.config, I added:

<serverUrl url="http://maps.evansvillegis.com"
           matchAll="true"></serverUrl>

Then I made sure my viewer.js file pointed to the current proxyUrl:

esriConfig.defaults.io.proxyUrl = 'proxypage_net/proxy.ashx';

However, when I try to print, I am getting the following error in the response:

{"error":{"code":400,"message":"Unable to complete operation.","details":["Error executing tool.: Layer \"layer1\": Unable to connect to map server at http://maps.evansvillegis.com/arcgis_server/rest/services/BASEMAPS/BASEMAP_GOOGLE_WGS84_NO_FOOTPRINTS_BW/MapServer.\nFailed to execute (Export Web Map).\nFailed to execute (Export Web Map Task)."]}}

I have seen related posts:

Secure Print Service Failed to Execute

ArcGIS Online printing Unable to connect to map server?

However, the provided information (mind you, limited) was not much help.

The 400 error - is this because my proxy is not setup correctly, or is there something wrong with my PrintTask service?

This is the default PrintTask that is configured with ArcGIS Server 10.2.1. The only other change I have made, is ensuring IIS users and the ArcGIS Server Account can access the ArcGIS Server directories.

Viewer: http://maps.evansvillegis.com/viewer

  • are your web application and print service even on different domains? if not, a proxy shouldn't be necessary. if you snoop the web traffic from within your app when printing, is the request even being routed through your proxy? (ie: do you see traffic routed toward server/proxy.ashx?http://urlofprintservice) – John Gravois Jul 18 '14 at 19:26
1

It might be the proxy setup, or it might be the code inside the JS you used.

There is a proxy parameter esriConfig.defaults.io.alwaysUseProxy. Try setting it to false. You can read about the proxy page here: https://developers.arcgis.com/javascript/jshelp/ags_proxy.html

Also you can add more serverUrls to your config since the basemap request goes to your defined server. The example is, for example, here: http://www2.microstrategy.com/producthelp/AnalyticsEnterprise/GISHelp/Lang_1033/topics/ESRIOnPremisesIntegration/ESRI_OnPremises_UseProxyServer.htm

  • Thanks for the links, but unfortunately I am not any further now than I was yesterday. The alwaysUseProxy was set to false already, and I have already added the serverUrl to the config file. – evv_gis Jul 16 '14 at 16:11
  • there is no need to set alwaysUseProxy to true. it would be better to let the API decide to use the proxy only when necessary (ie: when a print request is large enough to require a POST across domains.) – John Gravois Jul 18 '14 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.