use of org.glassfish.api.invocation.InvocationManager in project Payara by payara.
the class ServletPostHandler method handleRequest.
@Override
public boolean handleRequest(MessageContext context) {
WebComponentInvocation inv = null;
try {
WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
InvocationManager invManager = wscImpl.getInvocationManager();
inv = WebComponentInvocation.class.cast(invManager.getCurrentInvocation());
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((com.sun.xml.rpc.spi.runtime.Tie) inv.getWebServiceTie(), context);
if (!webServiceMethodInPreHandler.equals(postHandlerMethod)) {
throw new UnmarshalException("Original method " + webServiceMethodInPreHandler + " does not match post-handler method ");
}
}
} catch (Exception e) {
logger.log(Level.WARNING, LogUtils.POST_WEBHANDLER_ERROR, e.toString());
wsUtil.throwSOAPFaultException(e.getMessage(), context);
}
return true;
}
use of org.glassfish.api.invocation.InvocationManager in project Payara by payara.
the class ServletPreHandler method handleRequest.
@Override
public boolean handleRequest(MessageContext context) {
WebComponentInvocation inv = null;
try {
WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
InvocationManager invManager = wscImpl.getInvocationManager();
inv = WebComponentInvocation.class.cast(invManager.getCurrentInvocation());
com.sun.xml.rpc.spi.runtime.Tie tie = (com.sun.xml.rpc.spi.runtime.Tie) inv.getWebServiceTie();
if (tie == null) {
Implementor implementor = (Implementor) context.getProperty(MessageContextProperties.IMPLEMENTOR);
tie = implementor.getTie();
inv.setWebServiceTie(tie);
}
inv.setWebServiceMethod(wsUtil.getInvMethod(tie, context));
} catch (Exception e) {
logger.log(Level.WARNING, LogUtils.PRE_WEBHANDLER_ERROR, e.toString());
wsUtil.throwSOAPFaultException(e.getMessage(), context);
}
return true;
}
use of org.glassfish.api.invocation.InvocationManager in project Payara by payara.
the class Web109Adapter method postHandle.
@Override
protected void postHandle() {
final InvocationManager invocationMgr = V3Module.getInvocationManager();
invocationMgr.postInvoke(invocation);
}
use of org.glassfish.api.invocation.InvocationManager in project Payara by payara.
the class EjbContainerPostHandler method handleRequest.
@Override
public boolean handleRequest(MessageContext context) {
EJBInvocation inv = null;
try {
WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
InvocationManager invManager = wscImpl.getInvocationManager();
inv = EJBInvocation.class.cast(invManager.getCurrentInvocation());
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((com.sun.xml.rpc.spi.runtime.Tie) inv.getWebServiceTie(), context);
if (!webServiceMethodInPreHandler.equals(postHandlerMethod)) {
throw new UnmarshalException("Original method " + webServiceMethodInPreHandler + " does not match post-handler method ");
}
}
} catch (Exception e) {
wsUtil.throwSOAPFaultException(e.getMessage(), context);
}
return true;
}
use of org.glassfish.api.invocation.InvocationManager in project Payara by payara.
the class EjbContainerPreHandler method handleRequest.
@Override
public boolean handleRequest(MessageContext context) {
EJBInvocation inv = null;
try {
WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
InvocationManager invManager = wscImpl.getInvocationManager();
inv = EJBInvocation.class.cast(invManager.getCurrentInvocation());
Method method = wsUtil.getInvMethod((com.sun.xml.rpc.spi.runtime.Tie) inv.getWebServiceTie(), context);
inv.setWebServiceMethod(method);
if (!inv.authorizeWebService(method)) {
throw new Exception(format(logger.getResourceBundle().getString(LogUtils.CLIENT_UNAUTHORIZED), method.toString()));
}
} catch (Exception e) {
wsUtil.throwSOAPFaultException(e.getMessage(), context);
}
return true;
}
Aggregations