가장 간단 한 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> 


좋은 웹페이지 즐겨찾기