开发者

clientaccesspolicy.xml and subdomain

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


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜