Flex+BlazeDS集成开发的编译问题

Flex 调用远程或所在web应用的 BlazeDS服务时,必须建立和远端的通道channel,才能正常通信。
1. 通常的方式是 Flex 在编译时就指定远程的端点 Endpoint,service-config.xml 中的Endpoint 配置是 例如:

<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"

编译时指定的方式是在加编译参数,例如:
[quote] -services "services-config.xml" -context-root "/HelloBlazeds"[/quote]
services-config.xml 需要放在当前目录下,或者指定BlazeDS所在的配置文件路径。

http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=12209

2. 在 <mx:RemoteObject/> 对象中指定Endpoint参数:
例如:
 <mx:RemoteObject id="roOrder" destination="Hello" showBusyCursor="true" endpoint="http://server:8080/HelloBlazeDS/messagebroker/amf" >

1) 全路径: endpoint="http://server:8080/HelloBlazeDS/messagebroker/amf" >
2) 基于contextRoot: endpoint="/HelloBlazeDS/messagebroker/amf" >
3) 基于当前路径: endpoint="messagebroker/amf" >

总结:
对于Flex+BlazeDS集成开发,方式1,和2.1),2.2) 对于企业应用来说都不是最佳方案,因为他将 contextroot写死了,不便于移植,也就是说,编译后的 swf 放到其他应用下无法调用BlazeDS服务;
而对于互联网应用,如果假定 endpoint地址比较固定,编译时指定contextroot或endpoint全路径则是较好的选择,例如一个从google搜索信息Flex的小程序,放到桌面也能跑起来。

[参考资料]
1. http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=12209
2. http://www.iteye.com/topic/238127
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值