0
votes

I'm having a really strange problem (at least it is strange because it has worked for me in the past) with a Silverlight Application consuming WCF services.

When I debug both Silverlight Application and WCF in localhost it works perfect. When I publish both projects, they work perfect. The problem is when I try to debug the Silverlight Application against published WCF... it throws the typical crossdomain exception.

I promise I've both clientaccesspolicy.xml and crossdomain.xml uploaded into the root path in server.

Looking in fiddler, it doesn't even try to read the clientaccesspolicy file before crashing.

Do you have any idea??? Thanks in advance.

1

1 Answers

1
votes

Put these files inside your service folder

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 include-subpaths="true" path="/"/>
      </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">
<cross-domain-policy>
  <allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>