Pregunta

I am trying to post a cross-domain HTTP request but keep getting a SecurityException instead of a response.

I have added a clientaccesspolicy.xml:

<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>

aswell as a crossdomain.xml:

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>

to the silverlight app and set both to content + copy always.

What am I doing wrong?

¿Fue útil?

Solución

Do the xml files exist on the root of the sites? Maybe you could let Fiddler or any other network monitor run while attempting to access the service, this way you can see a 404 to the xml files and see where it goes wrong.

edit: also, you only need a clientaccesspolicy.xml if you are using Silverlight. The crossdomain.xml is a flash based domain policy file which Silverlight also understands.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top