Select to view content in your preferred language

Proxy page Issue after 10.1 Upgrade

694
3
02-25-2013 07:59 AM
BrianLord1
Deactivated User
Hello,

I have an application that I have been working on for a while that implements editing using the attribute inspector.  The app was created using one of the local gov't templates and it included a proxy page.  Prior to upgrading to ArcGIS Server 10.1, the editing was working and I was not having any issues with the proxy page.

After upgrading to 10.1, anytime the app needs to use the proxy page (editing or POST requests) I get a general error that says "NetworkError: 500 Internal Server Error".

Any ideas as to what might be causing this error?  As mentioned above, it only started occurring after the upgrade to 10.1.

Thanks,
Mark
0 Kudos
3 Replies
BrianLord1
Deactivated User
So I was looking into this more and found that if I debug the proxy.ashx (using visual studio) and run it on localhost (http://localhost:3274/appname/proxy.ashx) I am able to use the proxy to navigate to the applyedits rest endpoint.  However, if I try to use the proxy from where the app sits on my server i get the error and cannot get to the applyEdits rest endpoint.

Summing it up...
This works...
http://localhost:3274/appname/proxy.ashx?http://servername:6080/arcgis/rest/services/foldername/serv...

This does not work and I get the error.
http://servername/websites/appname/proxy.ashx?http://servername:6080/arcgis/rest/services/foldername...

The proxy.ashx and proxy.config are saved in the same folder as the html page for the app.  Kind of at a loss as to what to check next.  As I mentioned in my first post, this only occurred after upgrading to server 10.1 so I think it might have to do with adding the port number (servername: 6080) to the service rest endpoint url.
0 Kudos
HemingZhu
Frequent Contributor
So I was looking into this more and found that if I debug the proxy.ashx (using visual studio) and run it on localhost (http://localhost:3274/appname/proxy.ashx) I am able to use the proxy to navigate to the applyedits rest endpoint.  However, if I try to use the proxy from where the app sits on my server i get the error and cannot get to the applyEdits rest endpoint.

Summing it up...
This works...
http://localhost:3274/appname/proxy.ashx?http://servername:6080/arcgis/rest/services/foldername/serv...

This does not work and I get the error.
http://servername/websites/appname/proxy.ashx?http://servername:6080/arcgis/rest/services/foldername...

The proxy.ashx and proxy.config are saved in the same folder as the html page for the app.  Kind of at a loss as to what to check next.  As I mentioned in my first post, this only occurred after upgrading to server 10.1 so I think it might have to do with adding the port number (servername: 6080) to the service rest endpoint url.


next i would try to put a serverUrl including the port in proxy like this: <serverUrl url="http://servername:6080/arcgis(or your instance name)/rest/services" matchAll="true" /> and see what happen...
0 Kudos
BrianLord1
Deactivated User
Thanks for the response.

I did already have that in my proxy.config file.  Below is the code I currently have.

Proxy.Config...
<?xml version="1.0" encoding="utf-8" ?>

<ProxyConfig mustMatch="true">
  <serverUrls>
    <serverUrl url="http://serverName:6080/instance/rest/services/"
               matchAll="true"></serverUrl>   
  </serverUrls>

</ProxyConfig>


Code located in the main HTML page...
                esri.config.defaults.io.proxyUrl = "proxy.ashx"; //Setting to use proxy file
                esri.config.defaults.io.alwaysUseProxy = false;


Thanks,
Mark
0 Kudos