Jeffrey Lott
Jeffrey Lott

Reputation: 7419

Why is my Silverlight client not finding the clientaccesspolicy file when I switch to SSL?

I've developed a Silverlight client that has worked fine on regular HTTP, but now that I'm trying to get it to work on SSL, I'm getting the following error:

An error occurred while trying to make a request to URI [URL removed for security] 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.

I'm using the following clientaccesspolicy:

<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from http-request-headers="*">
        <domain uri="http://*"/>
        <domain uri="https://*"/>
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"/>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

Any ideas on what could cause this error?

Upvotes: 1

Views: 5704

Answers (3)

Cavan
Cavan

Reputation: 11

If you are running your Silverlight app in a browser, the browser could abort the connection if the SSL certificate is not trusted. If you manually navigate to the clientaccesspolicy.xml file (ie https://localhost/clientaccesspolicy.xml) you can add the certificate as trusted in your browser.

Upvotes: 1

Felipe
Felipe

Reputation: 31

This occurs because when you make a request to your site over a protocol different, the clientaccesspolicy.xml file. It isn't downloaded, check in your browser with any debug tool, and take a look for this file and check that is downloaded

Upvotes: 0

PortageMonkey
PortageMonkey

Reputation: 2725

I think you are missing one small item in your Client Access Policy. allow-from http-request-headersheaders should be ="SOAPAction".

Try this.

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

For further reference, check out this post by Tim Heuer

Upvotes: 1

Related Questions