clientaccesspolicy.xml 和子域

发布于 2024-08-20 00:45:30 字数 527 浏览 7 评论 0原文

我的网站有一个子域,我将此策略与我的 silverlight 应用程序一起使用,

<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
  <cross-domain-access>
    <policy>
  <allow-from http-request-headers="*">
    <domain uri="http://dev.system-engine.com"/>
  </allow-from>
  <grant-to>
    <resource path="/" include-subpaths="true"/>
  </grant-to>
</policy>

但我收到此异常:

错误:Silverlight 2 应用程序中未处理的错误 尝试以访问权限禁止的方式访问套接字。

它运行在linux主机上

my site has a subdomain, I use this policy with my silverlight app,

<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
  <cross-domain-access>
    <policy>
  <allow-from http-request-headers="*">
    <domain uri="http://dev.system-engine.com"/>
  </allow-from>
  <grant-to>
    <resource path="/" include-subpaths="true"/>
  </grant-to>
</policy>

but I get this exception:

Error: Unhandled Error in Silverlight 2 Application An attempt was made to access a socket in a way forbidden by its access permissions.

It is running on a linux host

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

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

发布评论

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

评论(1

贪恋 2024-08-27 00:45:30

您是否了解此客户端策略文件需要位于您正在访问的站点的路径上,而不是您的 Silverlight 应用程序?

例如,如果您的 silverlight 应用程序正在主机名为“system-engine.com”的服务器上运行,并且您尝试访问在“dev.system-engine.com”上运行的另一个网站上的服务,则客户端策略文件应该位于“dev.system-engine.com”服务器上,并且可以具有如下所示的 allow-from 元素:-

<allow-from http-request-headers="*"> 
  <domain uri="http://*.system-engine.com"/> 
</allow-from> 

这将允许在“system-engine.com”域中托管任何 silverlight 应用程序(包括其子域)访问服务器。

You understand that this client policy file needs to site at the route of the site you are accessing, not with your Silverlight application?

For example if your silverlight application is running on a server with the host name "system-engine.com" and you its trying to access services on another web site running on "dev.system-engine.com", the Client policy file should be on the "dev.system-engine.com" server and could have an allow-from element like this:-

<allow-from http-request-headers="*"> 
  <domain uri="http://*.system-engine.com"/> 
</allow-from> 

This would allow any silverlight app hosted within the the "system-engine.com" domain (including its sub-domains) to access the server.

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