java - 如何访问Flash内部的外部数据?

标签 java web-services flash crossdomain.xml

我是 flash 新手,我有一个 flash (.swf) 文件来通过 WSDL 方法显示我的数据库内容。加载后,我可以看到我的数据,但是当它尝试在内部自行刷新 Flash 对象时,它会显示一些错误。

我使用 eclipse 进行开发,Tomcat 7 作为网络服务器。

我已将 crossdomain.xml 放在/Root 文件夹中,我可以通过点击

通过网络浏览器显示 crossdomain.xml 内容
"http://localhost:8080/crossdomain.xml"

(Note : 1. Both web service and flash file are running in the same server.
        2. This error occurs only before accessing any data from server, once data is accessed the error is not generating anymore)

当 flash 文件尝试刷新自身时,它显示以下错误。

-->

To access external data, add a cross-domain policy file to the external data web server.



For more information, on the Adobe website, see the article "Cross-domain Policy File Specification".



If the problem persists, contact the file creator or your system administrator.


Error: Error #2032

Connection Type: Web Service

File URL: http://localhost:8080/StudentService/performance.swf

External Data URL: http://localhost:8080/StudentService/services/StudentService

最佳答案

尝试添加 to-port 属性和allow-http-request-headers-from 元素,如下所示..

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>
    <site-control permitted-cross-domain-policies="master-only"/>
    <allow-access-from domain="*" to-ports="*" secure="false"/>
    <allow-http-request-headers-from domain="*" headers="SOAPAction"/>
</cross-domain-policy>

谢谢。

@Leo。

关于java - 如何访问Flash内部的外部数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15238724/

相关文章:

java - Spring Framework 中邮件的重音支持

java - 使用命令行向 Apache Tomcat 服务器发送多个请求

c# - 尝试加载格式错误的程序 ERROR

android - as3 android保存从服务器下载的文件

javascript - 从 Actionscript 检测 Javascript 的可用性?

java - windowClosing() 方法没有被调用

java - PaintComponent 和 getTableCellRendererComponent 没有被调用

php - 如何知道电子邮件地址是否无效?

android - 支持 Android 的 Flash 游戏

java - Mac OS X 上的 JRE lib/security 目录在哪里?