Hello.
I have to use proxy for the querytask in the actionscript (not in the xml widget config). What is equivalent to <useproxy>true</useproxy> to actionscript?
Is there a property that I can use with the query? I couldn'r find one. Thanks.
var queryBuffer:Query = new Query();
queryBuffer.spatialRelationship = querySpatialRel;
queryBuffer.geometry = geom;
queryBuffer.returnGeometry = true;
queryBufferTask.url=layerConfig.url;
queryBuffer.outSpatialReference = map.spatialReference;
queryBuffer.outFields = layerConfig.outfields;
Solved! Go to Solution.
Lefteris,
It seems that there is an UNDOCUMENTED property of proxyURL on the QueryTask. So just use proxyURL on your QueryTask
Lefteris,
The QueryTask and Query does not have a proxyURL property or anything that you can set. You have to manually add the proxy url to the map service url like this:
Or use a FeatureLayer instead and it has a proxyURL property.
Thank you for the reply, Robert. I followed the suggestion and now I get the error:
Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
Do I need to use escape characters for the slashes?
My url was:
queryBufferTask.url= "http://xxx.xxx.xx.xxx/DotNetProxy/proxy.ashx?https://xxx.xxx.xxx.xxx/arcgis/rest/services/Project_PA...";
Thanks.
Lefteris,
It seems that there is an UNDOCUMENTED property of proxyURL on the QueryTask. So just use proxyURL on your QueryTask
Thank you Robert. I can't believe how did I miss the proxyURL since I was checking each property.
Using queryBufferTask.proxyURL= "http://xxx.xxx.xx.xxx/DotNetProxy/proxy.ashx?https://xxx.xxx.xxx.xxx/arcgis/rest/services/Project_PA...";
would draw the same error #2101.
However, using the url and the proxyURL, it works.
queryBufferTask.url="https://xxx.xxx.xxx.xxx/arcgis/rest/services/Project_PAD/PAD/FeatureServer/0"
queryBufferTask.proxyURL = "http://xxx.xxx.xxx.xxxx/DotNetProxy/proxy.ashx?";
I'm glad the problem got solved.
Just a quick note that the proxyURL is a property of BaseTask, which QueryTask inherits from. It's listed in the documentation at https://developers.arcgis.com/flex/api-reference/com/esri/ags/tasks/QueryTask.html#propertySummary. Make sure to "Show Inherited Public Properties".
I should have known that. Thanks for the clarification Bjorn.