views:

30

answers:

2

I have a WCF over SSL service that works no problem. I am able to add a reference to this service to my Silverlight Project. Everything is hosted in IIS7. When My app runs I get the following error

An error occurred while trying to make a request to URI 'https://wikittybam/BurgerCounter.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.

Now I've been Googling for hours here and 1) Yes I have a clientaccesspolicy added in the correct place and it is setup properly. I have used Fiddler and verified that the policy is being pulled down. 2) I have tried using a crossdomain policy as well same result. 3) The WCF service itself it working, I can connect to it with the WCFTestClient and pull the data that I want.

Any suggestions at this point would be greatly appreciated. If you would like any other information please let me know.

A: 

I suspect that you have a cross-schema url scenario where your Silverlight application is http and is attempting access a resource over https and this is not enabled in your clientaccesspolicy. Is http-to-https cross-schema access enabled in the clientaccesspolicy file? For more info, take a look at the URL Access Restrictions in Silverlight on msdn.

Mehmet Aras
I have gone through this document and yes my http-to-http cross-schema-access should be enabled. As per the document I have configured my policy such that<allow-from http-methods="*"> <domain uri="http://*"/></allow-from>I just watched a video that indicated that only a HTTPS Silverlight App can connect to an HTTPS WCF service. It looked like an older video and as per the documentation in the link above it looks like HTTP-HTTPS should work no problem.
Matt
A: 

I was finally able to resolve this. The issue was in the client access policy. I had the policy in the wrong location.

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

Some notes

  1. I setup Visual Studio 2010 to use Local IIS web server for both the service and the Silverlight UI. I am still getting a client access policy unreachable warning, but again everything seems to be working at this point.
Matt