1 Reply Latest reply on Feb 13, 2008 9:12 AM by ntsiii

    Extracting Web Service Fault Details?

    tmv_forum
      I'm not getting back the soap fault details in Flex 3 beta 3. Is there a way to extract the fault details in the soap message?



      -------------------------------------------------------------------------

      SOAP Request:

      POST /axis2/services/FooService HTTP/1.1
      Host: 127.0.0.1:8888
      User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
      Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png ,*/*;q=0.5
      Accept-Language: en-us,en;q=0.5
      Accept-Encoding: gzip,deflate
      Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
      Keep-Alive: 300
      Connection: keep-alive
      Cookie: JSESSIONID=1029d8599a1b5494d5272e4a4b14
      Referer: file:///C:/users/tools/bin/Authorization.swf
      Content-type: text/xml; charset=utf-8
      SOAPAction: "urn:createGroup"
      Content-length: 612

      <SOAP-ENV:Envelope xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">
      <SOAP-ENV:Body>
      <typens:createGroupRequest xmlns:typens=" http://service.foo.bar.com/xsd">
      <typens:group>
      <typens:groupId>0</typens:groupId>
      <typens:name>Admin</typens:name>
      <typens:description></typens:description>
      <typens:members xsi:nil="true"/>
      <typens:serviceMethods xsi:nil="true"/>
      </typens:group>
      </typens:createGroupRequest>
      </SOAP-ENV:Body></SOAP-ENV:Envelope>

      -------------------------------------------------------------------------
      SOAP Response:

      HTTP/1.1 500 Internal Server Error
      X-Powered-By: Servlet/2.5
      Content-Type: text/xml;charset=utf-8
      Transfer-Encoding: chunked
      Date: Wed, 13 Feb 2008 00:21:24 GMT
      Server: Sun Java System Application Server Platform Edition 9.0_01
      Connection: close


      <?xml version="1.0" encoding="utf-8"?>
      <soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Body>
      <soapenv:Fault>
      <faultcode>soapenv:Server</faultcode>
      <faultstring>FooServiceFaultMessage</faultstring>
      <detail>
      <ns1:FooServiceFault xmlns:ns1=" http://service.foo.bar.com/xsd">
      <ns1:code>GROUP_AK1</ns1:code>
      <ns1:message>Duplicate group.</ns1:message>
      </ns1:FooServiceFault>
      </detail>
      </soapenv:Fault>
      </soapenv:Body>
      </soapenv:Envelope>

      -------------------------------------------------------------------------
      Flex:

      public function fault(event:Object):void {
      trace(event.fault.faultDetail);
      }

      Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost:8888/axis2/services/FooService" URL: http://localhost:8888/axis2/services/FooService
      -------------------------------------------------------------------------