進行要求時發生錯誤。這可能是因為嘗試以跨網域方式存取服務,而沒有適當的跨網域原則所造成,或是由不適用於 SOAP 服務的原則所造成。您可能需要聯絡服務的擁有者,以發佈跨網域原則檔案,並確定它允許傳送 SOAP 相關的 HTTP 標頭

<>
I had received the error above when I try to use create a WCF service for my Silverlight application. I has spend several hours try to solve it.
Finally I found a solution for it from the Internet. What you need to do is to place a crossdomain.xml and clientpolicy.xml into the web-server’s root directory. (if you are testing your service from your Visual Studio, you can place it to the service’s project folder). Then you should be able to get around this problem.
These file can make the service available across domain boundaries
Here it is the reason of why we need those files from MSDN
Using for cross-domain communication requires guarding against several types of security vulnerability that can be used to exploit Web applications. Cross-site forgery is a class of exploits that becomes a threat when allowing cross-domain calls. This exploit involves a malicious Silverlight control transmitting unauthorized commands to a third-party service, without the user’s knowledge

I am not sure how to paste XML code here.
If you are interest about the crossdomain.xml and clientaccesspolicy, please visit the URL below.


Hope you find it useful

Leave a Reply