views:

254

answers:

2

So I'm using both xml files listed below with no luck. They both exist in the root of my IIS hosted web service on a different web server (behind the firewall). The web service is a simple POX like service that returns a JSON string.

Also I'm trying to get access to this service from a cassini run project on my local machine (to test it out). I can view the JSON from a browser but get a security error in silverlight when I try to do an HTTP GET using the same uri (4004 is the error code shown)

Anything simple that I missed here?

clientaccesspolicy.xml

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from http-request-headers="*">
        <domain uri="*"/>
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"/>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

crossdomain.xml

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"&gt;
<cross-domain-policy>
  <site-control permitted-cross-domain-policies="master-only" /> 
  <allow-access-from domain="*" secure="true" /> 
</cross-domain-policy>
A: 

If you get a 404 response code, the only reason can be that the server can not find the resource you are looking for. So are you absolutely sure you are using the correct url?

Ronald Wildenberg
The error is not a 404 but instead a security error showing a code of 4004 (shown above). I assume this security error is because of the cross domain access as it worked fine before I pushed the service to another server.
Toran Billups
Then who is generating the error? The Silverlight client? Do you have some more detailed error information?
Ronald Wildenberg
+2  A: 

Are you using a tool like fiddler to see what address the request for the cross domain policy file is pointed at? That's usually my first check; if the policy file isn't being found I'll know where it's supposed to be and if it is then I usually need to look elsewhere.

Your clientaccesspolicy.xml is identical to my reference one. Should be no problems there.

Raumornie
I did fire up Fiddler and noticed that I didn't have auth to access that service so I enabled anonymous access and it's working! Thank you for the obvious answer (use fiddler guy)!
Toran Billups