`

Silverlight 访问 其他域 tomcat

阅读更多
众所周知,若要允许 Silverlight 控件访问其他域上的服务,该服务必须明确选择允许跨域访问。 Silverlight 4 支持两种不同的机制供服务选择跨域访问:

在承载服务的域的根目录中放置一个 clientaccesspolicy.xml 文件,以配置服务允许跨域访问。

在承载服务的域的根目录中放置一个有效的 crossdomain.xml 文件。

我们这边使用的是 clientaccesspolicy.xml 。内容如下:
clientaccesspolicy.xml

<?xml version="1.0" encoding="utf-8"?>

<access-policy>

  <cross-domain-access>

    <policy>

      <allow-from http-request-headers="SOAPAction">

        <domain uri="*"/>

      </allow-from>

      <grant-to>

        <resource path="/" include-subpaths="true"/>

      </grant-to>

    </policy>

  </cross-domain-access>

</access-policy>


把clientaccesspolicy.xml 放在apache-tomcat-6.0.20\webapps\ROOT 下。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics