shuaiwei588 发表于 2017-1-23 08:07:16

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 下。
页: [1]
查看完整版本: Silverlight 访问 其他域 tomcat