I am using JAX-WS web services on Websphere V8. When the WS returns SOAP fault I want to do some updates in detail element. So I created SOAP handler:
public boolean handleFault(SOAPMessageContext messageContext) {
try {
SOAPMessage msg = messageContext.getMessage();
SOAPBody body = msg.getSOAPBody();
Detail d = body.getFault().getDetail();
Node esbException = d.getFirstChild();
// do some changes in detail element...
// save changes
msg.saveChanges();
return true;
} catch ....
return true;
}
I can update the Fault message, but client gets the original Fault (before changes). But when I print the updated Fault (in soap handler) I can see the changes (e.g. call msg.writeTo(System.out)).
Any clue why the updated Fault is not returned to ws client?
Thank you