Printing Via Proxy

4258
3
09-24-2012 04:36 PM
by Anonymous User
Not applicable
Hi,

Hoping someone can shed some light on the issue we're facing.

Scenario:

We have two web servers, one out in the DMZ for the public, one internal for staff.
We have two GIS servers which serve these two web servers (they have the same services, used for load balancing).
We have a public (non-secured) folder for public rest services.
We have an internal (secured) folder for staff only rest services which are only available on the internal web server.
We use tokens on the internal web server (not web tier) to authenticate the user so that they can view the internal services.

Issue:

The issue we are having is on the internal server we need to set esri.config.defaults.io.alwaysUseProxy to true so that the user can be authenticated. In doing so the print service returns an error 500. With alwaysUseProxy set to false as on the external server, everything is OK and it will print fine.

However looking at the proxy.ashx (using the dynamic one downloaded from the forum), it's coded to always return a status code of 500 in the ProcessRequest method regardless of what the error actually is. Removing the exception handling so that dotnet will log an event actually returns a 404. Firebug shows everything else loading fine via the proxy, in fact it shows requests to the print service are identical between between proxy and no proxy accept for http://server/arcgisserver/proxy/proxy.ashx? appended to the front of the proxy request.

We're not using HTTPS on any of the servers as the internal server is not accessible via the outside world. This works fine for the secured Map Service, but not the Print Service, which is public.

Our proxy config looks like:

<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig mustMatch="true">
   <serverUrls>
   <serverUrl url="http://server/arcgis/rest/services/Internal" matchAll="true" dynamicToken="true"></serverUrl>
   </serverUrls>  
</ProxyConfig>


We've tried putting the print server in there, leaving it out, all combinations of options with no success.

We made one change to the proxy.ashx where I've hard coded a full permission user in the tokenService string rather than using individual user names and passwords from the web.config.

string tokenService = "http://server/ArcGIS/tokens/?request=getToken&username=xxxxxx&password=xxxxxx&expiration=30";


We've run out of ideas. Any guidance much appreciated.
3 Replies
by Anonymous User
Not applicable
Update: we removed the spaces out of the Task Name and we no longer get the 404. The task name was the default ESRI one "Export Web Map", we changed it to "ExportWebMap".

Error: Unable to complete operation.
http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.1
Line 34

Firebug JSON respsone:

{"error":{"code":400,"message":"Unable to complete operation.","details":["Error executing tool.: Layer \"emap\": Unable to connect to map server at http://server/arcgis/rest/services/Internal/Consents/MapServer/.\nFailed to execute (ExportWebMap).\nFailed to execute (ExportWebMap)."]}}

Changing the layer to a public one to see if it still generates the same JSON response yields no problems at all and printing is fine.

I can see that the proxy is being called when the Print Button is clicked so I'm assuming the token is being passed through at that stage, however after that it is a mystery.
0 Kudos
AdrianMarsden
Occasional Contributor III

Ingrid - did you ever resolve this - I've hit similar issues Secure services - printing - 4 years on and still no luck

Cheers


ACM

0 Kudos
FlorianCADOZ
Occasional Contributor

Adrian, Ingrid,

Same question ...
Someone has find out an anwser ?

0 Kudos