我尝试使用以下代码将 actionscript 项目中的 blazeDS 连接起来:
ro = new RemoteObject();
var cs:ChannelSet = new ChannelSet();
cs.addChannel(new AMFChannel("my-amf", "http://localhost:8080/Ninja/messagebroker/amf"));
ro.channelSet = cs;
ro.destination = "test";
ro.source = "me.qiankanglai.test";
ro.addEventListener(ResultEvent.RESULT,r1);
ro.addEventListener(FaultEvent.FAULT,r2);
ro.sayHello();
但我无法连接服务器。我做了一个新的弹性项目,效果很好。我使用 chrome 查看连接详细信息(请求有效负载从一开始就不同)
动作脚本项目:
弹性项目:
事实上,我从 actionscript 项目中得到了一个错误:
TypeError: Error #1034: Type Coercion failed: cannot convert Object@5bec0b9 to mx.messaging.messages.ErrorMessage.
我不知道这两种远程对象方式有什么区别。