Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.3
-
None
-
Windows XP, Jdk 1.5, tomacat 5.5.
Description
I'm using the dispatch mechanism to invoke a soap service in message mode.
Upon catching the WebServiceException thrown by the dispatch.invoke method, i try to extract the soap fault information from it (if it is a SOAPFaultException). That's when i realized the SOAPFault detail is missing (is null). The code i'm using is shown below. Also shown is the returned soap fault with detail when the same service is called using SOAPUI.
It appears the SOAPFault detail is not set when it is wrapped into a SOAPFaultException and thrown as a WebServiceException.
//It appears that the JAX-WS implementation in
//cxf simply does not set the optional SOAPFault Detail object
//in the SOAPFault object wrapped by the SOAPFaultException
private SOAPMessage createFaultMessageFromWebServiceException(WebServiceException wse) throws SOAPException {
SOAPMessage msg = getNewSOAPMessage();
if (wse instanceof SOAPFaultException)
else
{ msg.getSOAPBody().addFault().setFaultString(wse.getMessage()); } return msg;
}
The same service invoked through SOAPUI returns SOAPFault message with detail.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Fault occurred while processing.</faultstring>
<detail>
<ns8:apiFault errorCode="item not found" objectName="0" objectType="categoryset" .../>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>