Blazeds 与Flex 发布时需要注意的问题
在通过blazeds实现消息时,FLEX发布时需要在设置里面将flexserver中将contextroot与web应用的contextroot名称设置成一样的!否则就不能正确的接收到消息
以下是相关的参数文章
关键字: flex blazeds
来自:http://hi.baidu.com/%C7%E1%BD%A3/blog/item/33ce7219256b894d42a9ad30.html
Flex 调用远程或所在web应用的 BlazeDS服务时,必须建立和远端的通道channel,才能正常通信。
1. 通常的方式是 Flex 在编译时就指定远程的端点 Endpoint,service-config.xml 中的Endpoint 配置是 例如:
Xml代码
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
编译时指定的方式是在加编译参数,例如:
引用
-services "services-config.xml" -context-root "/HelloBlazeds"
services-config.xml 需要放在当前目录下,或者指定BlazeDS所在的配置文件路径。
http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=12209
2. 在 <mx:RemoteObject/> 对象中指定Endpoint参数:
例如:
Xml代码
<mx:RemoteObject id="roOrder" destination="Hello" showBusyCursor="true" endpoint="http://server:8080/HelloBlazeDS/messagebroker/amf" >
<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服务;
相关文档:
flex代码:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768">
<fx:Script>
<!--[CDATA[
i ......
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontSize="12" creationComplete="init()">
<mx:Script>
<!--[CDATA[
import mx.utils.*;
import flash.net.*;
......
新的一期的flash&flex 国外的杂志发布,看来一班制作人真的很有心思。最近CSDN 图片上传不到,连写东西也不方便了。
所以就无办法贴图了
有兴趣的人可以到这里下载新的一期外国的关于flash 和flex 资讯的杂志。
http://ffdmag-en.software.alfa.javatech.com.pl/download-1-2010 ......
1、Subclipse
最近工作中,所有项目都在SVN中进行。由于Flex Builder没有内置SVN支持,很是不便。在编译时,”svn”文件夹会导致一些莫名错误。在编写Flash as时,我现在习惯用Flash Develop,小巧实用,也支持SVN。为了方便,给Flex Builder也装了SVN插件。由于FB基于Eclipse,安装方法都是一样的。
选择 He ......