I have two 10.3 ags servers that i thought were the same. But on one i can send this request to the rest api endpoint and it does not work:
http://xeballl03/arcgis/rest/services/Integrator/RouteMap/MapServer/3/query?f=json&where=STATE_NAME%3D%27Hawaii%27&returnGeometry=true&spatialRel=esriSpatialRelIntersects&outFields=*&callback=dojo.io.script.jsonp_dojoIoScript5._jsonpCallback
returns
dojo.io.script.jsonp_dojoIoScript5._jsonpCallback({"error":{"code":400,"message":"Failed to execute query.","details":[]}});
but on my other 10.3 server this does work
the call with the extra param in the url is being generated by a client app that i have (js api 2.0). How is that extra part generated? is it a setting in the js api?
-
If you send the command without the callback, do both servers work? To debug this, you should see if the issue is coming from the callback or from server configuration. Send both servers the same query and see what happens.Mintx– Mintx2015年03月20日 14:20:09 +00:00Commented Mar 20, 2015 at 14:20
1 Answer 1
the callback
param is included automatically by the JSAPI because it assumes that the server does not support CORS.
starting with version 3.0 both an automatic CORS check and the ability to declare CORS enabled servers manually were introduced.
all that said, there something must be wrong with your request or the instance of ArcGIS Server though, because just because a server supports CORS doesn't mean it should fail to respond to a JSONP request.
furthermore, an identical request to this 10.3 sample server returns the appropriate feature.
http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3/query?f=json&where=STATE_NAME='Hawaii'&returnGeometry=true&spatialRel=esriSpatialRelIntersects&outFields=*&callback=dojo.io.script.jsonp_dojoIoScript5._jsonpCallback
Explore related questions
See similar questions with these tags.