无法访问 silverlight web 服务

发布于 2024-09-16 13:50:19 字数 711 浏览 3 评论 0原文

我有一个允许一切的clientaccesspolicy.xml

我使用 javascript 从同一服务器的 aspx 弹出一个窗口。

aspx 调用 Web 服务但失败。

silverlight System.Security.SecurityException:安全错误。这 可能是由于尝试以跨域方式访问服务 没有适当的跨域策略,或者策略 不适合 SOAP 服务。

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

有什么想法吗?

I have a clientaccesspolicy.xml that allows everything.

I use javascript to pop up a window from an aspx 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

紫南 2024-09-23 13:50:19

我认为问题在于您配置的“ClientConfig.xml”文件应该称为“clientaccesspolicy.xml”并且位于网站的根目录中。

此处 是 Tim Heuer 撰写的一篇关于使用 clientaccesspolicy 文件的精彩文章。

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.

一场春暖 2024-09-23 13:50:19

我的 servicereference.clientconfig 指向 localhost 而不是部署服务器:-(

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文