I would like to catch the exception and throw my own ActionProcessingFaultException but when using a predefined action (e.g. SOAP Proxy Action) and it throws an exception (e.g. SaxParserException) there is no way (as I know of) to catch that exception and throw my own.
Specifying an exceptionMethod on some custom action doesn't allow me to actually catch the thrown exception (or alter the response), it only makes it possible to detect that an exception has occured.
I know that the quikstart states :
4. ant callSync2: demonstrates that an exception within the action chain, that is handled
by the service is still propagated back to the client invoker.
But what I was thinking, is when you throw your own exception in the exception handler, you might be able to override the ongoing process. Another option is to replace the body of the message with your own, because that message is propagated back.
Do you suggest that it might be possible to override the ongoing process by throwing an ActionProcessingFaultException within an exceptionMethod without catching the exception that has occured? If so, I have already tried this and it doesn't work.
Replacing the message body with something else doesn't work in an exceptionMethod (unless it is an ActionProcessingFaultException) since the output returned to the caller of the service seems to be based upon the exception.
The problem your having is that the exeption is beeing handled by JBossESB, to override this handeling you will need to be able to controle the result of a JBossESB pipeline. To do this, the only way I have found is to invoke the pipline (read JBossESB Service) yourself with a serviceInvoker and put the call between a try catch block. This way you can catch any exception and return anything you want back to the client. So you will need to have a pre-service where you initiate the serviceinvoker and then call your actual (processing) service. So instead of 1 you will need 2 JBossServices.
Regards,
Hans