How to unmarshal a SOAP Fault in a FaultMessageResolver?
I'm new to Spring-WS, and slowly getting my head wrapped around it. Right now, I'm writing a simple client to communicate with an existing WS. I'm using the WebServiceTemplate and the marshalSendAndReceive method. Everything works fine.
However, when a SOAP fault occurs, the WST throws a SoapFaultClientException. I noticed that I can create my own FaultMessageResolver to check what is contained within the SOAP fault. However, when I try to unmarshal the WebServiceMessage in my FaultMessageResolver, I get the following error message:
Obviously, my unmarshaller is not properly configured. Do I have to generate the JAXB fault model myself using xjc to then be able to unmarshal the error? I am somewhat amazed that this does not already exist.
JAXB unmarshalling exception; nested exception is javax.xml.bind.UnmarshalException: unexpected element (uri:"http://schemas.xmlsoap.org/soap/envelope/", local:"Fault"). Expected elements are ....
Is there a better way to extra my custom error information from within my soap:fault response? My error looks something like the following:
<faultstring>Blaze Data Error</faultstring>
<ns14:serviceErrors xmlns="http://www.nb.com/ClientServices/LendingSimulation/CalculateProfitabilityRequest" xmlns:ns13="http://www.nb.com/fw/errorMgmt" xmlns:ns14="http://www.nb.com/ClientServices/LendingSimulation/V1" >
<ns13:errorMessage>Unable to retreive additional data</ns13:errorMessage>
<ns13:fieldName>Message error received from PHClient : [An unexpected error code was received : system=PH context=[empty]]</ns13:fieldName>
Same unmarshalling Exception
I am also having the same issue, did you find a solution for this?
Originally Posted by benze