ArcGIS Server API For Flex 安全沙箱问题

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cross-domain-policy SYSTEM
"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"
>
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all" />
<allow-access-from domain="*" />
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>

将此内容保存为crossdomain.xml,crossdomain.xml文件必须放置在域的根目录处,以tomcat为例,文件需放置在webapps\ROOT 下,IIS则放在C:\inetpub\wwwroot.

由于arcgis 9.3 server同样是以REST方式发布服务,所以当需要允许外域访问arcgis 服务时,同样需要设置跨域

crossdomain.xml放置的目录是{arcgis安装目录}\ArcGIS\java\web_output

PS:

补充下,在调试时layer.InitializationFailure.Message提示的是

A security exception occurred wile trying to connect to the rest endpoint make sure you hava a cross domain policy file acailable at the root for your server that allows for requests from this application

希望对刚开始学silverlight API的同学有帮助

原文地址:https://www.cnblogs.com/biandande/p/1932079.html