clientaccesspolicy.xml 和子域
我的网站有一个子域,我将此策略与我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否了解此客户端策略文件需要位于您正在访问的站点的路径上,而不是您的 Silverlight 应用程序?
例如,如果您的 silverlight 应用程序正在主机名为“system-engine.com”的服务器上运行,并且您尝试访问在“dev.system-engine.com”上运行的另一个网站上的服务,则客户端策略文件应该位于“dev.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:-This would allow any silverlight app hosted within the the "system-engine.com" domain (including its sub-domains) to access the server.