如何在FLEX 3中处理SOAP响应

时间:2010-05-29 05:16:32

标签: flex web-services soap response


SOAP请求
<?xml version =“1.0”encoding =“UTF-8”?>

< S:Envelope xmlns:S =“http://schemas.xmlsoap.org/soap/envelope/”>    
< S:Header />    
< S:Body>        
< ns2:deleteDataView xmlns:ns2 =“http://ws.$$$$$.@@@@@.#####”>             
<标识符> 5℃/标识符GT;         < / NS2:deleteDataView>

</S:Body>

< / S:信封>


SOAP响应
<?xml version =“1.0”encoding =“UTF-8”?> < S:Envelope xmlns:S =“http://schemas.xmlsoap.org/soap/envelope/”>     < S:车身>        
< ns2:deleteDataViewResponse xmlns:ns2 =“http://ws.$$$$$.@@@@@.#####”>            
< return>错误:遇到错误,请稍后再试< / return& gt

< / ns2:deleteDataViewResponse>     < / S:车身> < / S:信封>

我想在flex中读取SOAP响应,是某些 到FLEX,请帮助,即使是好的资源也能正常工作。< / p>

1 个答案:

答案 0 :(得分:1)

处理SOAP响应

<mx:WebService
      id="userRequest"
       wsdl="http://www.gnpcb.org/esv/share/soap/index.php?wsdl">

       <mx:operation name="doPassageQuery" resultFormat="object"
            fault="mx.controls.Alert.show(event.fault.faultString)"
            result="showResult(event)"/>
 </mx:WebService>

在上面的代码中,您正在访问SOAP WebService,现在您的resultFormat是 Object ,结果函数是showResult()

  private function showResult(e:ResultEvent):void 
   {
   trace(e.result);
   }

<强>资源

http://www.flexlive.net/?p=79