首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 媒体动画 > flex >

Flex通过Hessian与Java通信

2012-11-07 
【原创】Flex通过Hessian与Java通信import mx.rpc.IResponderpublic class MyResponder implements IRespon

【原创】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));}

?

?

热点排行