1.新建Flex应用程序
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
creationComplete="application1_creationCompleteHandler(event)">
<s:layout>
<s:BasicLayout/>
</s:layout>
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.soap.WebService;
protected function application1_creationCompleteHandler(event:FlexEvent):void
{
// TODO Auto-generated method stub
var webws:WebService = new WebService();
webws.wsdl="http://localhost:8080/com.Hello?wsdl";
webws.loadWSDL();
webws.sayHello("suxiaoyong");
webws.addEventListener(ResultEvent.RESULT,resultFunction);
}
private function resultFunction(e:ResultEvent):void{
testTxt.text=e.result.toString();
}
]]>
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<s:Label id="testTxt" />
</s:Application>
2.启动服务端
3.启动flex客户端
4.如果弹出以下界面,表示成功