Flex 应用程序可以在 bin-debug 中运行,但不能在 bin-release 中运行
我开发了一个小型 Flex 应用程序,它执行一些 Web 服务调用、检索一些数据并将数据返回到应用程序。
只要我在 Flex Builder (eclipse) 中工作或者只要我从 ProjectName\bin-debug 运行它,一切都会正常工作。
一旦我尝试部署它(从 ProjectName\bin-release 或在 Web 服务器上运行它),它就会停止工作,并收到一条错误消息: - 无法加载 WSDL。如果当前在线,请验证 WSDL 的 URI 和/或格式 (http://127.0.0.1/ TimeSheet/TimeSheets.wsdl)
我创建了一个我认为正确的跨域文件,并将其放置在 IIS C:\inetpub\wwwroot 的根文件夹中(为了安全起见,我也将该文件复制到 C :\inetpub 和 C:\inetpub\wwwroot\TimeSheet)
<跨域策略> <允许访问域=“*”/> <站点控制允许的跨域策略=“master-only”/> <允许访问域=“*”安全=“假”/>
我在阅读互联网后也尝试修改编译属性 项目->属性-> Flex 编译器通过将 -use-network= 属性更改为 true 和 false 以及 -debug 属性。
我相信,如果我能让垃圾箱释放工作,那么一切都会工作。
有什么区别?
I have developed a little flex application which does some web service calls, retrieves some data and returns the data to the application.
Everything works fine as long as I am working inside Flex Builder (eclipse) or as long as I run it from the ProjectName\bin-debug.
Once I try to deploy it (run it from ProjectName\bin-release or on a web server) it stops working and I get an error stating:
- Unable to load WSDL. If currently online, please verify the URI and/or format of the WSDL (http://127.0.0.1/TimeSheet/TimeSheets.wsdl)
I have created a cross domain file which I think is correct and placed it in the root folder of IIS C:\inetpub\wwwroot (I have also just to be safe copied the file to C:\inetpub and C:\inetpub\wwwroot\TimeSheet)
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*"/>
<site-control permitted-cross-domain-policies="master-only"/>
<allow-access-from domain="*" secure="false"/>
<allow-http-request-headers-from domain="*"/>
</cross-domain-policy>
I have also after reading the internet tried modifying the compilation properties
Project -> Properties -> Flex Compiler by changing the -use-network= property to both true and false and the -debug property.
I believe that if I can get the bin-release working then it will all work.
What is the difference?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@阿玛戈什
我尝试过 localhost 和 127.0.0.1 以及服务器名称
@Jeff
是的,它有效
好的,我有更多信息。我发现它在 bin-debug 文件夹中工作而不是在 bin-release 文件夹中工作的原因是因为在 bin-debug 文件夹中应用程序在本地受信任的
安全沙箱类型(sandBoxType.text = Security.sandboxType.toString) 中运行())
并且 bin-release 文件夹在 localwithfile 或 localwithnetwork 中运行(也取决于 -use-network 属性的设置)
要使其在 bin-release 文件夹中工作,我所要做的就是将其添加到我的受信任站点内置Flash播放器。
太棒了......除了它必须在网络服务器上运行,以便人们可以在我们的本地网络上访问它。从我所看到的情况来看,当从“网络”访问 swf 文件时,即不是电脑上的本地文件,它总是在远程沙箱类型中运行,并且在远程沙箱类型中运行时,它会给我与上面相同的错误。
那么,我是否必须遵循一些特殊规则才能允许我的小应用程序在远程沙箱类型中运行时访问 wsdl?
@Amarghosh
I have tried localhost and 127.0.0.1 and the server name
@Jeff
Yes and it works
Okay I have some more information. I have figured out that the reason that it works in the bin-debug folder and not in the bin-release folder is because in the bin-debug folder the app runs in the localtrusted
Security Sandboxtype (sandBoxType.text = Security.sandboxType.toString())
And the bin-release folder runs in localwithfile or localwithnetwork (depending on what the -use-network property is set too)
To make it work inside the bin-release folder all I had to do was add it to my trusted sites inside flash player.
Fantastic... except this has to run on a web server so that people can access it on our local network. From what I have seen when a swf file is accessed from the "web" i.e. not a local file on a pc it always runs in remote sandboxtype and it gives me the same error as above when running in a remote sandboxtype.
So are there some special rules that I have to follow to allow my little app to access the wsdl when running in a remote sandboxtype?