我正在努力让 Flex SWF(嵌入在 JSP 中)来访问远程数据(来自另一个域)。
我有一个 crossdomain.xml(嵌入在我的 SWF 中)。其内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all" />
<allow-access-from domain="*"/>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
在我的 main.xml 中,我使用以下方法加载 crossdomain.xml 文件:
Security.loadPolicyFile("http://www.mysite.com:8380/CSS/ReviewItemsServer/crossdomain.xml");
当我通过浏览器访问 JSP 网页时,嵌入式 SWF 尝试进行 Java 远程调用,我收到以下错误:
Error string = Send failed
Error code = Client.Error.MessageSend
Error details = Channel.Security.Error error Error #2048:
Security sandbox violation: http://www.mysite.com/CSS/ReviewItemsServer/ReviewItemsMain.swf
cannot load data from http://www.mysite.com:8380/CSS/ReviewItemsServer/messagebroker/amf. url:
我很确定 crossdomain.xml 文件实际上是由 SWF 加载的,因为我创建了一个简单的 URLLoader 来加载 xml 文件并检查是否没有错误。所以我不认为这是一个问题......
当我在调试模式下运行 SWF...我还看到以下错误消息:
Error: [strict] Ignoring policy file at http://www.mysite.com:8380/CSS/ReviewItemsServer/crossdomain.xml due to missing Content-Type. See http://www.adobe.com/go/strict_policy_files to fix this problem.
任何帮助将不胜感激......
标记