上下文:我正在开发一个用FDT开发的Flash应用程序,并用Flash CS4编译(我需要一个巨大的库)。它应该连接到各种Weborb服务。
Weborb配置正确。我的服务通过管理控制台正确执行并返回值。Weborb示例以及用Flex编译的各种测试都是全功能的。
问题:当我尝试调整代码以使用Flash编译,并像这样设置远程对象时:
var remoteObject = new RemoteObject();
remoteObject.destination = "GenericDestination";
remoteObject.source = "MyServices.MyService";
remoteObject.addEventListener("fault", onFault);
remoteObject.getFoo.addEventListener("result", onResult);我得到了以下错误:
faultCode: InvokeFailed
faultString: '[MessagingError]'
faultDetail: 'null'如果我尝试以这种方式设置通道:
var channelSet:ChannelSet = new ChannelSet();
var amfChannel:AMFChannel = new AMFChannel("my-amf",
"http://localhost/weborb/weborb.php");
channelSet.addChannel(amfChannel);
var remoteObject = new RemoteObject();
remoteObject.channelSet = channelSet;
remoteObject.destination = "MyServices/MyService";然后我得到了这个错误:
faultCode: Client.Error.MessageSend
faultDetail: Channel.Connect.Failed
url: 'null'问:如何正确设置RemoteObject,以便从用Flash编译的Flash应用程序连接到Weborb远程服务?
这快把我逼疯了。
发布于 2011-06-11 20:08:47
我正在使用以下代码以编程方式配置RemoteObject:
var channelSet:ChannelSet = new ChannelSet();
var channel:Channel = new AMFChannel("my-amf", "http://localhost/weborb/weborb.php");
channelSet.addChannel(channel);
var ro:RemoteObject = new RemoteObject("SomeCustomDestination");
ro.source = "Full.Class.Name.With.Namespace";
ro.channelSet = channelSet;
// invoking service
var op:AbstractOperation = ro.getOperation("SomeCustomMethod");
op.addEventListener(ResultEvent.RESULT, onResult);
op.send(params);SomeCustomDestination是在WEB-INF/flex/services-config.xml中定义的,服务器需要它,但客户端需要识别它才能访问。服务器可能会为您的目的地发布访问策略(安全约束)。
发布于 2009-11-12 23:34:29
这是我前段时间的post。也许这会有帮助。
https://stackoverflow.com/questions/1721881
复制相似问题