Trigger handleFault method in jax-rpc message handler
posted 9 years ago
I've got a set of JAX-RPC document-literal web-services, along with a basic message handler, all running in JBoss. I'm having trouble triggering the handleFault method upon the message handler when an exception is thrown within my web-service code.
I've currently configured things (before adding the handler) so that an XML document (that details the error) is serialized into the SOAPFaultException Detail object that gets generated by JBoss when I throw my custom fault (as defined in the WSDL etc).
I want to manipulate this error document prior to it going back to the client - and so I added a handler. It works fine with handleRequest, but I cannot get it to trigger the handleFault method? Does the exception I throw HAVE to be a SOAPFaultException in order for the handler to trigger (as apposed to my custom exception defined in the WSDL etc)?
What has to be characteristic of the exception thrown in order for the handleFault method on the handler to be triggered?
What I want is for me to throw an exception containing my serialized error XML, which then passed into the handleFault method of the handler. Does anyone have any tips as to how I can do this?