QueryTask and proxy problem -

2174
2
05-06-2012 11:17 AM
JayGregory
New Contributor III
I've constructed a query task that returns the number of points in a polygon. 
This query task works perfectly if the query is against an internal map service (map service on the same arcgis server as the proxy). 
However, if I set the query task to an external map service:

queryTaskWithin = new esri.tasks.QueryTask("http://rmgsc.cr.usgs.gov/ArcGIS/rest/services/nhss_haz/MapServer/0");


but change nothing else about the query or query task, it fails with the following error:

Error: Unable to load /proxy/proxy.ashx?http://rmgsc.cr.usgs.gov/ArcGIS/rest/services/nhss_haz/MapServer/0/query status:403


My proxy config shouldn't be the problem because - as I am on a test server, I've made it wide open, by setting ProxyConfig mustMatch="false". I didn't even need to include my internal map service in the proxy.config, and the query worked fine for that. 

Any ideas what could be going on?

Thanks, Jay
0 Kudos
2 Replies
ShreyasVakil
Occasional Contributor II
What I understand from your description, place this http://services.arcgisonline.com/clientaccesspolicy.xml xml file in root directory of your server. Also place http://services.arcgisonline.com/crossdomain.xml this xml file in your servers root directory.

What I mean from server's root directory is the same directory where you placed your proxy.

These XML's help in granting access to request's coming from other domains to your server.
0 Kudos
JayGregory
New Contributor III
Thanks for your help - sorry for not responding earlier.  I actually got around my issue by applying a layer definition.  The information I needed to filter by was contained in the title string (state). 
Thanks!
Jay




What I understand from your description, place this http://services.arcgisonline.com/clientaccesspolicy.xml xml file in root directory of your server. Also place http://services.arcgisonline.com/crossdomain.xml this xml file in your servers root directory.

What I mean from server's root directory is the same directory where you placed your proxy.

These XML's help in granting access to request's coming from other domains to your server.
0 Kudos