远程与AIR [英] Remoting with AIR
问题描述
我试图建立远程在AIR应用程序。
Hi I am trying to set up remoting in an AIR app.
有谁知道,如果我需要在编译器设置中定义的上下文根。 似乎无法找到设置它,只有在柔性的文章。
Does anyone know if I need to define a context-root in the compiler settings. Can't seem to find any articles about setting it up, only in flex.
感谢
推荐答案
编译器设置如下:
-servicesX:\ tomcat的\ webapps中\ BlazeDS的\ WEB-INF \弯曲\ services-config.xml中
-services "X:\tomcat\webapps\blazeds\WEB-INF\flex\services-config.xml"
不过,如果你想空气在HTTP你必须安装它升技不是一个Web应用程序不同。说不上来为什么,但使用web应用程序的足够设置在BlazeDS的柔性服务器或whatver使用和后端时,比使用类似
however, if you want AIR to work over http you have to setup it abit different than a webapp. dunno why, but when using a webapp its enough to setup the flex-server on blazeDS or whatver backend you use and than use something like
protected function createData(event:MouseEvent):void
{
var javaObject : RemoteObject = new RemoteObject("YOUR_CONFIGURED_JAVA_CLASS");
javaObject.showBusyCursor = true;
var token : AsyncToken = javaObject.YOUR_JAVA_METHOD();
token.addResponder(new mx.rpc.Responder(dataResult,handleFault));
}
但使用空气时,你必须设置一个目标和终点,否则将无法连接,你将最终和错误,如
but when using AIR you HAVE to setup a destination and endpoint, otherwise it will fail to connect and you will end up with and error like
Channel.Connect.Failed错误 NetConnection.Call.Failed:HTTP: 失败:网址: HTTP://ain.swf/blazeds/messagebroker/amf
'Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://ain.swf/blazeds/messagebroker/amf''
所以,对于AIR应用程序必须添加以下
so, for AIR apps you have add the following
javaObject.endpoint = "http://IP:PORT/blazeds/messagebroker/amf";
javaObject.destination = "hello";
在这里又见面是config'd的java类你打电话。
where hello again is the config'd java-class you're calling.
希望帮助。
这篇关于远程与AIR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!