I think I figured out that by returning null in action classes or throwing
ActionProcessingException can stop the service execution, then I can override the error handling code in @OnException method.
I am trying to send back a custom XML reply to the client code (if something goes wrong) which invoked my service on HttpGateway lets say
<error code="X0001">SOMETHING BAD HAPPENED</error>
anybody has sample code?
is it possible to send custom XML response back to Http client in a method which is annotated with @OnException
I have a sample code in an action which throws one business exception, it executes the the method also but doesnt send the custom XML back. here is the code. All I see is exception stack trace which caused this methd to execute....
public void error( Message msg )
log.info("+++++++++++++++++++ In error() +++++++++++++ :: OUCH " + msg.getFault());
String error = "<fault code=\"111\" order_id=\"O1234567\"><cause desc=\"SOMETHING BAD HAPPENED\"/></fault>";
HttpResponse response = new HttpResponse(200);
//HttpResponse response = HttpResponse.getResponse(msg); // throws NPE