Silverlight-to-WCF cross-domain exception, but clientaccesspolicy.xml is being read successfully

匿名 (未验证) 提交于 2019-12-03 01:05:01

问题:

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 path="/" include-subpaths="true" />       </grant-to>     </policy>   </cross-domain-access> </access-policy>

crossdomain.xml:

<?xml version="1.0"?> <!DOCTYPE cross-domain-policy> <cross-domain-policy>   <allow-http-request-headers-from domain="*" headers="*" secure="true" /> </cross-domain-policy>

Nothing fancy here, it's the standard setup millions of WCF services use to allow Silverlight clients to access them. Unfortunately this setup is not working in the live environment I deployed to. The pre-production environment used to test the deploy is setup identically to live (or so the sysadmins claim) and everything works perfectly there, which is why I am so confused.

I had one of the sysadmins trace the request from the Silverlight client using HTTPDebuggerPro, and it shows that the client is retrieving both clientaccesspolicy.xml and crossdomain.xml without issue (HTTP status 200). However, after requesting those files, the client tries to make a call to the service and immediately receives a CrossDomainException.

I have also tried getting the sysadmins to add the WCF service URL to Internet Explorer's "Allowed Sites" list on the box that the Silverlight client is hosted on (as per the last sentence of the last paragraph from http://blogs.msdn.com/b/fiddler/archive/2010/11/22/fiddler-and-silverlight-cross-zone-cross-domain-requests.aspx) but that didn't work either.

HALP!

回答1:

Is clientaccesspolicy.xml placed in the root of your domain?



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!