1
votes

I am trying to hit a self hosted WCF service I created that uses HTTPS. I am able to hit the service with WCFClientTest tool and through the web browser however my silverlight application is not working. I am getting the following error:

This could be due to to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent.

I do have the clientaccesspolicy.xml in place and I can see the silverlight app is getting it ok when i view it through fiddler. The xml file contains the following:

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

The problem is, even though the silverlight application appears to be requesting AND receiving that file, it is still throwing the error message that it needs to allow cross domain access.. any ideas??

Thanks in advance.

2

2 Answers

2
votes

Take care with address and port your application is trying to consume WCF Service. Use Fiddler to see where it's calling (I've had many problems like this with that because the error for VS is the same... it doesn't find the Service).

Anyway here you have a clientaccesspolicy.xml that is working:

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