开发者

Can't access silverlight web service

开发者 https://www.devze.com 2023-01-14 23:37 出处:网络
I have a clientaccesspolicy.xml that allows everything. I use javascript to pop up a window from an a开发者_如何学编程spx from the same server.

I have a clientaccesspolicy.xml that allows everything.

I use javascript to pop up a window from an a开发者_如何学编程spx from the same server.

The aspx calls the web service but fails.

silverlight System.Security.SecurityException: Security error. 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.

<?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>

Any idea?


I think the problem is that the file you have configured "ClientConfig.xml" should be called "clientaccesspolicy.xml" and be in the root of the website.

Here is a great post by tim heuer on using the clientaccesspolicy file.


My servicereference.clientconfig was pointing to localhost instead of the deploy server :-(

0

精彩评论

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