0

我使用 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 作为通道

提前致谢。

4

2 回答 2

2

您是否使用“https”uri 并使用 AMFChannel 而不是 SecureAMFChannel 构建 remoteObject 的 channelSet?

这种通用错误可能意味着任何事情,并且更有可能与 IIS 非常棒有关。尽管问题可能与您调用远程操作的方式有关...

如果您已将远程服务抽象为一个神奇的类,请发布一些代码,我可能会为您提供一些建议......或者我可能不会......'on sait jamais'

很快和你谈谈,杰里米

于 2010-11-11T23:30:58.000 回答
0

badversion 错误通常是 Web 服务器在执行远程调用时显示错误而不是抛出异常 amf 样式的结果。由于 amf 客户端无法解析响应,因此您会收到该错误消息。

于 2010-11-15T15:15:42.723 回答