2 Replies Latest reply on Nov 13, 2006 12:16 PM by ntsiii

    Help: Flex can't parse web service fault message correctly

    withnature
      When I use class WebService to issue requests but the server-side returns error, it is assumed the instance of FaultEvent class in fault-event-handler contains error information. However when inspecting member variables of the object I can only found some very general error information which can't be mapped to the original error on server side.

      E.g.

      The server side returns a SOAP document to Flex like:

      <env:Envelope xmlns:env=" http://schemas.xmlsoap.org/soap/envelope/">
      <env:Header />
      <env:Body>
      <env:Fault>
      <faultcode>env:Client</faultcode>
      <faultstring>com.sap.sbs.silo.bean.interfaces.ServiceException: [SESSION] : No session can serve the request, pls check if the session is expired!</faultstring>

      <detail>
      <ns1:ServiceException xmlns:ns1=" http://service.bean.silo.sbs.sap.com" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">

      <reason>-1</reason>
      <message>[SESSION] : No session can serve the request, pls check if the session is expired!</message>

      </ns1:ServiceException>
      </detail>
      </env:Fault>
      </env:Body>
      </env:Envelope>

      But instance of FaultEvent class in Flex fault-event-handler only contains general error informatin like: (the following values are gotten during debug)

      event = mx.rpc.events.FaultEvent
      - fault = mx.rpc.Fault (@541e5e1)
      - description = "HTTP request error" : String
      - detail = "Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error。 URL: http://PVGD50033332A:8080/silo/SessionService" URL: http://PVGD50033332A:8080/silo/SessionService" : String

      - errorID = 0 [0x0] : Number
      - faultCode = "Server.Error.Request" : String
      - faultcode = "Server.Error.Request" : String
      - faultDetail = "Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error。 URL: http://PVGD50033332A:8080/silo/SessionService" URL: http://PVGD50033332A:8080/silo/SessionService" : String

      - faultString = "HTTP request error" : String
      - faultstring = "HTTP request error" : String
      - message = "faultCode:Server.Error.Request faultString:'HTTP request error' faultDetail:'Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error。 URL: http://PVGD50033332A:8080/silo/SessionService" URL: http://PVGD50033332A:8080/silo/SessionService'" : String

      - name = "Error" : String
      - rootCause = flash.events.IOErrorEvent (@5572371)
      - bubbles = false : Boolean
      - cancelable = false : Boolean
      - currentTarget = flash.net.URLLoader (@541e431)
      - eventPhase = 2 [0x2] : Number
      - target = flash.net.URLLoader (@541e431)
      - text = "Error #2032: Stream Error。 URL: http://PVGD50033332A:8080/silo/SessionService" : String

      - type = "ioError" : String

      Could anybody tell me where I can find the original error information like 'No session can serve the request, pls check if the session is expired!' in Flex web service framework?