开发者

Silverlight 3/WCF Communication over SSL Issue

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 Goggling for hours here and 1) Yes I have a clientaccess开发者_如何学Pythonpolicy 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 cross-domain 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.


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://*"/>
           <domain uri="https://*"/>
        </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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜