Print Task and Proxy page

848
4
Jump to solution
02-04-2014 07:22 AM
BryanLynn
New Contributor III
I seem to have the opposite problem from most posts that I have seen on this issue.  If I use a proxy page with my PrintTask - it fails.  If I set "alwaysUseProxy" to false - it works as expected.  When I execute the task with the proxy page, it throws a 500 error immediately. The PrintTask will eventually return a timeout error to the client.  Proxy page works fine with all the map services.

Any thoughts?

Thanks,
Bryan
0 Kudos
1 Solution

Accepted Solutions
BryanLynn
New Contributor III
Thanks for the info jgravois.

Turns out John was correct the spaces in the URL were causing problems with my proxy page.  Essentially the spaces were being replaced with "+" characters.

Here is the fix I used to get around it:
        if (theUri.Contains("Export+Web+Map+Task"))         {             theUri = theUri.Replace("Export+Web+Map+Task", "Export%20Web%20Map%20Task");         }

View solution in original post

0 Kudos
4 Replies
JohnGravois
Frequent Contributor
this is just a guess, but i've seen proxy pages that threw up when they encountered spaces in the url of the resource they are attempting to forward.  this is relevant because the out of the box print task includes the operation name 'Export Web Map Task'.

what happens when you try and ping the url below directly in the browser?
http://localhost/yourproxy.ashx?http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities...
0 Kudos
BryanLynn
New Contributor III
OK, that makes sense but now I am a little confused.

The following link to your site brings back the REST API page:
http://test2.kgis.org/proxy/proxy.ashx?http://sampleserver6.arcgisonline.com/arcgis/rest/services/Ut...

The following link to our site brings backa 500 ProtocolError and the body of the page simply says "System.Net.HttpWebResponse"
http://test2.kgis.org/proxy/proxy.ashx?http://test2.kgis.org/arcgis/rest/services/PrintingTools/Prin...

In my mind, if the problem is with the proxy page, shouldn't it have returned the error for both links?  By no means do I think our proxy page is error free, it just seems odd to me.

Thanks,
Bryan
0 Kudos
JohnGravois
Frequent Contributor
sounds like the space itself isn't a problem, but for some reason some (or all?) requests to internal resources fail.  does that sound like an accurate assessment?

if so, my first suggestion would be to logon to the server machine and see if you can access those resources directly in the browser.  if so, it might be worth asking for IT help to create a new application pool for the proxy and assign it to utilize a different identity so that you could use a tool like fiddler to inspect the actual web traffic the proxy is spawning to the resource itself.
0 Kudos
BryanLynn
New Contributor III
Thanks for the info jgravois.

Turns out John was correct the spaces in the URL were causing problems with my proxy page.  Essentially the spaces were being replaced with "+" characters.

Here is the fix I used to get around it:
        if (theUri.Contains("Export+Web+Map+Task"))         {             theUri = theUri.Replace("Export+Web+Map+Task", "Export%20Web%20Map%20Task");         }
0 Kudos