没有 services-config.xml 的 Flash RemoteObject Weborb 连接(无 Flex)

发布于 2024-08-11 03:51:52 字数 1167 浏览 1 评论 0原文

背景:我正在开发一个使用 FDT 开发并使用 Flash CS4 编译的 Flash 应用程序(我需要一个巨大的库)。它应该连接到各种 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 远程处理服务?

这让我抓狂。

Context : I'm working on a Flash application developed with FDT and compiled with Flash CS4 (I need a huge library). It should connect to various Weborb services.

Weborb is properly configured. My services are properly executed, and values returned, via the management console. Weborb examples as well as various tests compiled with Flex are fully functionnal.

Problem :
when I try to adapt the code to compile with Flash, and setup the remote object like this :

var remoteObject = new RemoteObject();
remoteObject.destination = "GenericDestination";
remoteObject.source = "MyServices.MyService";
remoteObject.addEventListener("fault", onFault);
remoteObject.getFoo.addEventListener("result", onResult);

I get the following fault :

faultCode: InvokeFailed
faultString: '[MessagingError]'
faultDetail: 'null'

If I try to setup a channel this way :

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";

I then get this fault :

faultCode: Client.Error.MessageSend
faultDetail: Channel.Connect.Failed
url: 'null'

Question: how to properly setup a RemoteObject to connect to a Weborb remoting service from a Flash application compiled with Flash ?

This is driving me nuts.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

丢了幸福的猪 2024-08-18 03:51:52

我使用此代码以编程方式配置 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 中定义的,这是服务器,但客户端需要识别它才能访问。服务器可能会为您的目的地发布访问策略(安全约束)。

I am using this code to configure RemoteObject programatically:

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 is defined in WEB-INF/flex/services-config.xml which is needed by the server, but client needs to identify it to access. Server may issue access policy (security constraint) for your destination.

拥有 2024-08-18 03:51:52

This a post of mine from a while ago. Maybe this will help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文