我使用 Flex 作为我的客户端,使用 Java 作为我的服务器。在远程主机中使用 WebOrb。有时我会收到此错误。
faultCode:Client.Error.MessageSend
faultString:'发送失败'
faultDetail:'Channel.Connect.Failed 错误 NetConnection.Call.BadVersion: :
url: 'http://foo.com:5480/bar/weborb.wo''
我不知道为什么会这样。我用谷歌搜索它并没有找到答案。如果我在故障处理程序中处理它,一切正常。但我想知道为什么会这样。我应该怎么做才能避免这个错误。
任何帮助将不胜感激。
谢谢回复。。
这是我的抽象代码
public class FOOProxy implements IFOOProxy
{
public static var FOO_PROXY:IFOOProxy;
private var remote:RemoteObject;
public function FOOProxy()
{
}
public function runCommand(request:IClientRequest):void
{
remote.addEventListener("result", onResult);
remote.addEventListener("fault", onFault);
if(request is GeneralRequest)
{
var req:Request = request as CmdRequest ;
if (req.requestType == fooController.UPDATE_REQUEST)
{
remote.requestTimeout=null;
}else
{
remote.requestTimeout = 30;
}
}
remote.runCommand(request);
}
public function onResult(event:ResultEvent):void {
var result:Object = (event as ResultEvent).result as Object ;
/*
Updating my result using callback.
*/
CursorManager.removeBusyCursor();
}
public function onFault(event:FaultEvent):void {
if(event.fault.faultCode=="Client.Error.MessageSend")
{
//This is where "NetConnection.call.badversion occurs"
}
else if(event.fault.faultCode=="Server Exception")
// Server Exception Handling
{
//Dispatch Something
}
}
public static function createProxy(callback:ICallback):IFOOProxy {
if (FOO_PROXY != null) {
FOO_PROXY.setCallback(callback);
return FOO_PROXY;
}
var iProxy:IFOOProxy = new FOOProxy();
var proxy:FOOProxy = iProxy as FOOProxy;
//setting my callback here to update
proxy.remote = new RemoteObject();
proxy.remote.destination = "Rpc";
return proxy;
}
}
这是它与服务器连接的地方-:目标ID“Rpc”
我正在使用 https,端口号 5480 并在远程 -config.xml 中使用安全 amf 作为通道
提前致谢。