- <xsd:schema xmlns:xsd="" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="">
- <xsd:element name="getKey">
<xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" type="xsd:string" />
<xsd:element maxOccurs="1" minOccurs="1" name="in1" nillable="true" type="xsd:string" />
xsd:sequence>
xsd:complexType>
xsd:element>
- <xsd:element name="getKeyResponse">
<xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true" type="xsd:string" />
xsd:sequence>
xsd:complexType>
xsd:element>
- <xsd:element name="login">
<xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" type="xsd:string" />
<xsd:element maxOccurs="1" minOccurs="1" name="in1" nillable="true" type="xsd:string" />
xsd:sequence>
xsd:complexType>
xsd:element>
- <xsd:element name="loginResponse">
<xsd:element maxOccurs="1" minOccurs="1" name="out" type="xsd:boolean" />
xsd:sequence>
xsd:complexType>
xsd:element>
xsd:schema>
wsdl:types>
- <wsdl:message name="getKeyResponse">
<wsdl:part name="parameters" element="tns:getKeyResponse" />
wsdl:message>
- <wsdl:message name="getKeyRequest">
<wsdl:part name="parameters" element="tns:getKey" />
wsdl:message>
- <wsdl:message name="loginResponse">
<wsdl:part name="parameters" element="tns:loginResponse" />
wsdl:message>
- <wsdl:message name="loginRequest">
<wsdl:part name="parameters" element="tns:login" />
wsdl:message>
- <wsdl:portType name="UserServicePortType">
- <wsdl:operation name="getKey">
<wsdl:input name="getKeyRequest" message="tns:getKeyRequest" />
<wsdl:output name="getKeyResponse" message="tns:getKeyResponse" />
wsdl:operation>
- <wsdl:operation name="login">
<wsdl:input name="loginRequest" message="tns:loginRequest" />
<wsdl:output name="loginResponse" message="tns:loginResponse" />
wsdl:operation>
wsdl:portType>
- <wsdl:binding name="UserServiceHttpBinding" type="tns:UserServicePortType">
<wsdlsoap:binding style="document" transport="" />
- <wsdl:operation name="getKey">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="getKeyRequest">
<wsdlsoap:body use="literal" />
wsdl:input>
- <wsdl:output name="getKeyResponse">
<wsdlsoap:body use="literal" />
wsdl:output>
wsdl:operation>
- <wsdl:operation name="login">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="loginRequest">
<wsdlsoap:body use="literal" />
wsdl:input>
- <wsdl:output name="loginResponse">
<wsdlsoap:body use="literal" />
wsdl:output>
wsdl:operation>
wsdl:binding>
- <wsdl:service name="UserService">
- <wsdl:port name="UserServiceHttpPort" binding="tns:UserServiceHttpBinding">
<wsdlsoap:address location="" />
wsdl:port>
wsdl:service>
wsdl:definitions>
===============================================================================
GetKeyFromXFire.mxml
layout="vertical"
verticalAlign="middle"
backgroundColor="white" viewSourceURL="srcview/index.html">
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.utils.ObjectUtil;
private var startTime:int;
private var endTime:int;
private function button_click():void {
//执行webservice的getKey(String in0, String in1)操作
webService.getKey('fisher','123456');
startTime = getTimer();
lbl.text = "";
}
private function getKeys_result(evt:ResultEvent):void {
//将getKey(String in0, String in1)结果赋予textArea
textArea.text = ObjectUtil.toString(evt.result);
calcTime();
}
private function getKeys_fault(evt:FaultEvent):void {
Alert.show(evt.type);
calcTime();
}
private function calcTime():void {
endTime = getTimer();
lbl.text = "total time: " + (endTime - startTime) + "ms";
}
]]>
wsdl="">
resultFormat="object"
result="getKeys_result(event);"
fault="getKeys_fault(event);" />
label="get key from web service"
click="button_click();" />
editable="false"
width="100%"
height="100%" />