Invocation inv = null;
boolean continueProcessing = true;
try {
Switch theSwitch = Switch.getSwitch();
InvocationManager invManager = theSwitch.getInvocationManager();
inv = (Invocation) invManager.getCurrentInvocation();
Container container = (Container) inv.container;
Method webServiceMethodInPreHandler = inv.getWebServiceMethod();
if( webServiceMethodInPreHandler != null ) {
// Now that application handlers have run, do another method
// lookup and compare the results with the original one. This
// ensures that the application handlers have not changed
// the message context in any way that would impact which
// method is invoked.
Method postHandlerMethod =
wsUtil.getInvMethod(inv.getWebServiceTie(), context);
if( !webServiceMethodInPreHandler.equals(postHandlerMethod) ) {
inv.exception = new UnmarshalException
("Original method " + webServiceMethodInPreHandler +
" does not match post-handler method " +
postHandlerMethod);
}
}
} catch(Exception e) {
String errorMsg = "Exception while getting method for " +
((inv != null ) ?
((Container) inv.container).getEjbDescriptor().getName() : "");
inv.exception = new UnmarshalException(errorMsg);
inv.exception.initCause(e);
}
if( inv.exception != null ) {
logger.log(Level.WARNING, "postEjbHandlerError", inv.exception);
wsUtil.throwSOAPFaultException(inv.exception.getMessage(),
context);
}
return true;