AnsweredAssumed Answered

javascript Print Secured Service

Question asked by dmortenson on May 27, 2014
Latest reply on Mar 10, 2018 by mcin8130
Hello.
This seems to be a popular question, but with few answers.

I have a intranet website that uses one secured service in a directory called Secure. All services in this directory have been secured and show up as map services using a proxy as anticipated.  The problem comes with the printing.

I have followed the directions as described on this website:
http://resources.arcgis.com/en/help/main/10.2/index.html#/Printing_maps_that_contain_secured_services/0154000005q3000000/

I have put the secured ExportWebMapSecure service in the Secure directory mentioned above. (I have also tried it in my customized public utilities, with no more success.)

It doesn't work. 

Couple of questions:
1) What is the proper way to call the proxy for the print.js?  I have tried two ways:

A:
 urlUtils.addProxyRule({
              urlPrefix: "http://server_for_gis/arcgis/rest/services/Secure",
              proxyUrl: "http://server_for_web/apps/gis/Proxy/proxy.ashx"
          });


B:
esriConfig.defaults.io.proxyUrl = "http://server_for_web/apps/gis/Proxy/proxy.ashx";



2) If I were to test the  service directly using JSON,  how do I include the proxy?  On this page:
http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/ExportWebMap_specification/02r3000001mz000000/
It doesn't mention the proxy. It only has the token. So it's not very helpful to test the proxy.

"operationalLayers": [
{
  "id" : "mytheme",
                "opacity": 1,
                "visibility": true,
                "url": "http://server_for_gis/arcgis/rest/services/Secure/mytheme/MapServer"
}]


3)  The error message I get right now is this. Even when there isn't any secured services being called.

http://server_for_web/apps/gis/Proxy/proxy.ashx?http://server_for_gis/arcgis/rest/services/Secure/ExportWebMapSecure/GPServer/Export%20Web%20Map?f=json status: 500"



This is using the following in my print.js:
 urlUtils.addProxyRule({
              urlPrefix: "http://server_for_gis/arcgis/rest/services/Secure",
              proxyUrl: "http://server_for_web/apps/gis/Proxy/proxy.ashx"
          });



4) Should the ExportWebMap be in the Secure directory?

Thank you in advance for any clarification you can make. 

Dorothy

Outcomes