I am calling a SOAP webservice using JAX WS. In the case of an error I am getting the following response from the client (I see this in my trace log):
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP- ENV="http://schemas.xmlsoap.org/soap/envelope/"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>Error</faultcode>
<faultstring>Error</faultstring>
<SOAP-ENV:detail>
<BLAServiceFault xmlns:ns="http://messages.testservice.com/TestService/2012/10">
<ns:ReturnStatus>
<ns:ReturnCode>-97</ns:ReturnCode>
<ns:ReturnStatusSpecification>
<ns:SubCode xsi:nil="true"/>
<ns:Description>The price of productA must be higher than 30.</ns:Description>
</ns:ReturnStatusSpecification>
</ns:ReturnStatus>
</BLAServiceFault>
</SOAP-ENV:detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
As you can see the useful error is in the detail node:
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<SOAP-ENV:detail>
In my client I am getting a SOAPFaultException which has a SOAPFault object. The SOAPFault object seems to be missing the node I posted above. SOAPFaultException.getFault().getDetail() is null.The exception is javax.xml.ws.soap.SOAPFaultException: Error. How can i get the detail node with description?
Thanks.