this.sendType = sendType;
}
public void invoke(MessageContext msgContext) throws AxisFault {
HandlerInfoChainFactory handlerFactory = (HandlerInfoChainFactory) this.getOption(Constants.ATTR_HANDLERINFOCHAIN);
HandlerChainImpl handlerImpl = null;
if (handlerFactory != null) handlerImpl = (HandlerChainImpl) handlerFactory.createHandlerChain();
boolean result = true;
try {
if (handlerImpl != null) {
try {
result = handlerImpl.handleRequest(msgContext);
}
catch (SOAPFaultException e) {
handlerImpl.handleFault(msgContext);
msgContext.setPastPivot(true);
return;
}
}
if (result) {
try {
super.invoke(msgContext);
} catch (AxisFault e) {
msgContext.setPastPivot(true);
if (handlerImpl != null) {
handlerImpl.handleFault(msgContext);
}
throw e;
}
} else {
msgContext.setPastPivot(true);
}
if ( handlerImpl != null) {
handlerImpl.handleResponse(msgContext);
}
} catch (SOAPFaultException e) {
msgContext.setPastPivot(true);
throw AxisFault.makeFault(e);
} catch (RuntimeException e) {
SOAPFault fault = new SOAPFault(new AxisFault("Server", "Server Error", null, null));
SOAPEnvelope env = new SOAPEnvelope();
env.addBodyElement(fault);
Message message = new Message(env);
message.setMessageType(Message.RESPONSE);
msgContext.setResponseMessage(message);
throw AxisFault.makeFault(e);
}
finally {
if (handlerImpl != null) {
handlerImpl.destroy();
}
}
}