Unable to view map service with ClientAccessPolicy file in place

837
3
02-09-2011 03:43 PM
ScottMcEachern
New Contributor III
We have encountered an issue with ArcGIS Server dynamic map services that are not visible within the Silverlight application; it does not seem to be the typical ClientAccessPolicy file issue.

On a single server there is ArcGIS Server 10 with the dynamic map services.  The server also contains the Silverlight web application.  The application was published into the default web site; http://serverName/ApplicationName.  The default web site also contains the ClientAccessPolicy.XML file (C:\inetpub\wwwroot).  The map services are available within the application without any issues.  The URL to the map services is http://ServerName/ArcGIS/rest/services/MapServiceName/MapServer.

When the site was moved into application into a new web site on the same server with a host header of �??www.SomeName.grp�?�, the map services failed to initialize.  There was the following error, from the InitializationFailure event of the layer:

A security exception occured 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.

Using Fiddler, it was found that a request to get the metadata of the map service or ClientAccessPolicy.XML file was never made.

We updated the URL to the one of the map service to use the IP address rather than the server name.  This map service then worked; the ClientAccessPolicy file was first download and then the map service.

Any help would be great,
Scott
0 Kudos
3 Replies
DanielWalton
Occasional Contributor
Can you post the contents of your client access policy file?
0 Kudos
ScottMcEachern
New Contributor III
Can you post the contents of your client access policy file?


Hello,

Below is the ClientAccessPolicy file:

<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
<domain uri="http://*"/>
<domain uri="https://*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
0 Kudos
DanielWalton
Occasional Contributor
You might try removing the line <domain uri="*"/>, but I don't think that's your problem. The only reasons I can think of that Silverlight is not requesting the xml file is 1) you're requesting a resource which is not a well formed URI, and 2) the resource appears to be in the same domain as your application. I would guess that your problem is #1. Can you post the actual (or slightly adjusted) URI to your service, including the domain suffix?
0 Kudos