0

For some reason my crossdomain.xml is never accepted by Silverlight and I'm getting the SecurityException everytime. I'm using SL4 and HTTPS. The server is offline to begin with, the first request fails. After 60 seconds, the client again requests for the crossdomain.xml, I return the file, as given below, but I get the security exception. I'm using Fiddler to return the file.

Also interesting is that it works with clientaccesspolicy.xml but that is requested only the first time and all subsequent requests only ask for crossdomain.xml. The file is as below

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from>      
        <domain uri="*"/>
      </allow-from>            
    </policy>
  </cross-domain-access>
</access-policy>
Jeff Yates
  • 61,417
  • 20
  • 137
  • 189
Chan
  • 49
  • 4

3 Answers3

0

Try:

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from>      
        <domain uri="*"/>
        <domain uri="https://*"/>
      </allow-from>            
    </policy>
  </cross-domain-access>
</access-policy>
brimble2010
  • 17,796
  • 7
  • 28
  • 45
0

crossdomain.xml file should have another content:

<?xml version="1.0"?>
<cross-domain-policy>
  <allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
Alexey F
  • 1,763
  • 14
  • 19
  • Unfortunately I still get the security exception. I'm not sure why does it not request for the clientaccesspolicy.xml again because that works but the crossdomain.xml does not. – Chan Feb 22 '11 at 11:31
0

Take a look to this post from SO: SecurityError when calling a HTTPS-WCF Service from Silverlight 4

Community
  • 1
  • 1
Samvel Siradeghyan
  • 3,523
  • 3
  • 30
  • 49
  • Samvel the thread above is exactly the same problem as mine. As you must have noticed it worked for him with the clientaccesspolicy.xml, however when there is only a crossdomain.xml it doesn't work. Having a clientaccesspolicy is actually masking the issue. For some reason the crossdomain.xml is not getting accepted, in SL4 if the server is offline to begin with, the client requests for a policy file every 60 seconds, however it only requests for the crossdomain.xml from the 2nd try onwards and that is the whole issue. – Chan Feb 22 '11 at 11:38