Select to view content in your preferred language

Proxy and FeatureLayers

480
1
04-15-2013 02:06 PM
MBNorton
New Contributor
proxyURL does not work for FeatureLayers. The message in the error window, you know the security sandbox deal, does not change when proxyurl is added to the featurelayer. It's as if the proxyurl attribute of a featurelayer doesn't exist. Here's the kicker, the proxyurl does work for AttributeInspector and ArcGISDynamicMapServiceLayer with the exact same proxy.php within the same mxml application file
This might be a bit confusing, so check this out.
Lets say you have a basic MXML application file named: MapApp.mxml.
In that file, you have an AttributeInspector, DynamicMapServiceLayer and a FeatureLayer. You build and run > Security Sandbox error. You go back to your application file and add a proxy.php to your bin-debug and to all three layers you include the attribute and value, proxyurl="proxy.php". (Assume that the proxy.php file was also setup correctly)
You then build and run the application. Before the page loads you receive the sandbox security violation error again, the same error message you encountered prior to adding the proxyURL. You then go back to your application and comment out the feature layer. Build > Run. It works.
There is one main difference between the Feature Layer and the other two. The url of the featurelayer is a sub of the attributeinspector and dynamicmapservicelayer.
Here are the URLs:
DynamicMapServiceLayer: http://certmapper.cr.usgs.gov/arcgis/rest/services/geology/northamerica_gmna/MapServer
AttributeInspector: http://certmapper.cr.usgs.gov/arcgis/rest/services/geology/northamerica_gmna/MapServer
FeatureLayer: http://certmapper.cr.usgs.gov/arcgis/rest/services/geology/northamerica_gmna/MapServer/24
In my proxy.php file, my list of URLs contains http://certmapper.cr.usgs.gov/arcgis/rest/services/geology/northamerica_gmna/MapServer with matchAll set to true. Note: I have tried the following without success.

array( 'url' => 'http://certmapper.cr.usgs.gov/arcgis/rest/services/geology/northamerica_gmna/MapServer',        'matchAll' => true, 'token' => '' )
---
array( 'url' => 'http://certmapper.cr.usgs.gov/arcgis/rest/services/geology/northamerica_gmna/MapServer',        'matchAll' => true, 'token' => '' )
array( 'url' => 'http://certmapper.cr.usgs.gov/arcgis/rest/services/geology/northamerica_gmna/MapServer/24',        'matchAll' => true, 'token' => '' )
---
array( 'url' => 'http://certmapper.cr.usgs.gov/arcgis/rest/services/geology/northamerica_gmna/MapServer',        'matchAll' => false, 'token' => '' )
array( 'url' => 'http://certmapper.cr.usgs.gov/arcgis/rest/services/geology/northamerica_gmna/MapServer/24',        'matchAll' => false, 'token' => '' )

I have also set mustMatch to false. Still no change.
--
Here's what does work
Comment out the featurelayer and set the following in the proxy.php file
array( 'url' => 'http://certmapper.cr.usgs.gov/arcgis/rest/services/geology/northamerica_gmna/MapServer',        'matchAll' => true, 'token' => '' )

In a nutshell, the proxyURL attribute of a featurelayer does not work.
Tags (2)
0 Kudos
1 Reply
DasaPaddock
Esri Regular Contributor
Have you tried a tool like HttpFox or Fiddler to see if the HTTP requests from your browser are going to the proxy?
0 Kudos