WCF cross-domain policy security error
        Posted  
        
            by 
                George2
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by George2
        
        
        
        Published on 2009-08-28T07:00:33Z
        Indexed on 
            2010/12/23
            7:54 UTC
        
        
        Read the original article
        Hit count: 308
        
Hello everyone,
I am using VSTS 2008 + C# + WCF + .Net 3.5 + Silverlight 3.0. I host Silverlight control in an html page and debug it from VSTS 2008 (press F5, then run in VSTS 2008 built-in ASP.Net development web server), then call another WCF service (hosted in another machine running IIS 7.0 + Vista). The WCF service is very simple, just return a constant string to client.
When invoking the WCF service from Silverlight, I got the following error message,
An error occurred while trying to make a request to URI 'https://LabTest/Test.svc'. This could be due 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. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.
Here is the clientaccesspolicy.xml file, anything wrong?
<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from  http-request-headers="*">
        <domain uri="*">
        </domain>
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"></resource>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>
thanks in advance, George
© Stack Overflow or respective owner