Select to view content in your preferred language

WebAdapter & CrossDomain Policy

2541
1
02-26-2013 03:47 PM
AngelGonzalez
Frequent Contributor
Using the 3.1 SL API and ArcGIS Server 10.1 sp1 I was creating a simple SL app. Just displaying a map service. Nothing else.

The Service was defined as :


<esri:ArcGISDynamicMapServiceLayer Url="http://abc/arcgis/rest/services/VRP9/MapServer"
                       InitializationFailed="ArcGISDynamicMapServiceLayer_InitializationFailed" />


Every time I ran the app I kept getting the following:

"A security exception occurred while trying to connect to the REST endpoint. Make sure you have a cross domain policy file available at the root for your server that allows for requests from this application."

I check that I had the cross domain policy file at  C:\inetpub\wwwroot on the server. I then reference a 10.0 ArcGIS server map service and the map appeared. I copied the cross domain policy file from the 10.0 server to 10.1 and still got the same error. After a while I tried the following url to the 10.1 Server:


<esri:ArcGISDynamicMapServiceLayer Url="http://abc:6080/arcgis/rest/services/VRP9/MapServer"
                       InitializationFailed="ArcGISDynamicMapServiceLayer_InitializationFailed" />


and the map appeared in my SL app.

ESRI, Since I am using the Webadaptor on my 10.1 ArcGIS Server do I need to reference port 6080 used by the Webadaptor??

I have not seen any documentation on this.

Note: When I first reference the 10.1 map service without the 6080 port number I could see the map on the Design Preview pane but when I ran the app I got the error message. Also my Dev machine and the Servers are on different boxes.


Thanks.
0 Kudos
1 Reply
DominiqueBroux
Esri Frequent Contributor
ESRI, Since I am using the Webadaptor on my 10.1 ArcGIS Server do I need to reference port 6080 used by the Webadaptor??


Since version 10.1, ArcGIS server communicates over port 6080 and not the standard web port 80.
From the client you can either hit directly arcgis server (port 6080) or hit the web adaptor with the port you choose during installation (generally 80).

From your URL: http://abc:6080/arcgis/rest/services/VRP9/MapServer, it seems you are not going through the web adaptor (so http://abc/arcgis/rest/services/VRP9/MapServer can't work).
You'll find documentation about cross domain requests to arcgis server here: http://resources.arcgis.com/en/help/main/10.1/index.html#//01550000051q000000
0 Kudos