`
towne
  • 浏览: 37513 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
文章分类
社区版块
存档分类
最新评论
  • mapeijie888: 谢谢 能不能把  此文相关的代码发至邮箱  mapeijie8 ...
    mock测试
  • towne: 如Calendar,Date等类型则需要用户自己实现Conve ...
    XStream
  • jinkingmanager: 讲的挺好,不过我有些问题想问一下: 1 如果一个XML中对应有 ...
    XStream
  • towne: 在web项目中测试servlet比较麻烦,像servletRe ...
    mock测试

一个最简单的flex-rpc调用的例子

阅读更多
<?xml version="1.0" encoding="utf-8"?> 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> 
<mx:Script> 
<![CDATA[ 
import mx.rpc.events.ResultEvent; 
import mx.controls.Alert; 
[Bindable] 
public var xml:XML=new XML(); 
public function testResult(e:ResultEvent):void { 
 xml=XML(e.result); 
 if(xml.toString().length>0) { 
  this.showValue.text=this.xml.toString(); 
 } 
} 

public function hello():void { 
 this.myWebService.Login(this.aa.text,this.aa0.text); 
} 
]]> 
</mx:Script> 
<mx:WebService id="myWebService" 
wsdl="http://localhost:999/sp2/services/Login?wsdl" 
useProxy="false" 
fault="Alert.show(event.fault.toString())" 
result="testResult(event)"> 
<mx:operation name="Login"/>
</mx:WebService> 
<mx:Button x="381" y="107" label="login" width="82" click="hello();"/> 
<mx:TextInput x="173" y="149" text="Label" id="showValue" width="290" height="300"/> 
<mx:TextInput x="173" y="79" id="aa" /> 
<mx:TextInput x="173" y="107" id="aa0" />
</mx:Application> 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics