【原创】Flex通过Hessian与Java通信
import mx.rpc.IResponder;public class MyResponder implements IResponder{private var _a:Function;private var _b:Function;public function MyResponder(result:Function,fault:Function){_a = result;_b = fault;}//onResult call the call back functionpublic function call_a(data:Object):void{_a.call(null,data);}//onFault call the fault handlerpublic function call_b(info:Object):void{_b.call(null,info);}//the function in IResponderpublic function result(data:Object):void{call_a(data);}//the function in IResponderpublic function fault(info:Object):void{call_b(info);}}
?
private function callHello():void{var service:HessianService=new HessianService("http://10.1.0.69:8080/learnHessian/learnhessian");var token:AsyncToken=service.hello.send();token.addResponder(new MyResponder(myResultHandler, myFaultHandler));}
?
?