Silverlight与WCF通信发生cross-domain错误

写了一个Silverlight客户端,试图与WCF通信,可是无论如何都跳出Cross-domain的错误,在网上找了很久,按照网上的建议,添加clientaccesspolicy.xml和crossdomain.xml,仍然无效果。继续google,偶然发现,将clientaccesspolicy.xml删掉,crossdomain.xml的内容改为:
<cross-domain-policy>
         <allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>

居然就好了。我靠。。。。

几个不错的page:
1. http://timheuer.com/blog/archive/2008/04/09/silverlight-cannot-access-web-service.aspx
2. http://www.joelhainley.com/index.php/2009/02/04/silverlight-communication-exception-was-unhandled-by-user-code/
3. http://forums.lhotka.net/forums/thread/27639.aspx
4. http://silverlight.net/forums/t/43293.aspx

你可能感兴趣的:(xml,PHP,.net,silverlight,WCF)