FileDocCategorySizeDatePackage
ServletPostHandler.javaAPI DocGlassfish v2 API4135Fri May 04 22:36:12 BST 2007com.sun.enterprise.webservice

ServletPostHandler

public class ServletPostHandler extends javax.xml.rpc.handler.GenericHandler
This handler is inserted last in the handler chain for an servlet web service endpoint.
author
Kenneth Saks

Fields Summary
private static Logger
logger
private WsUtil
wsUtil
Constructors Summary
public ServletPostHandler()


      
Methods Summary
public javax.xml.namespace.QName[]getHeaders()

        return new QName[0];
    
public booleanhandleRequest(javax.xml.rpc.handler.MessageContext context)

        ComponentInvocation inv = null;

        try {
            Switch theSwitch = Switch.getSwitch();
            InvocationManager invManager = theSwitch.getInvocationManager();
            inv = invManager.getCurrentInvocation();

            Method webServiceMethodInPreHandler = inv.getWebServiceMethod();
            if( webServiceMethodInPreHandler != null ) {
                Method postHandlerMethod = 
                    wsUtil.getInvMethod(inv.getWebServiceTie(), context);
            
                if( !webServiceMethodInPreHandler.equals(postHandlerMethod) ) {
                    throw new UnmarshalException
                        ("Original method " + webServiceMethodInPreHandler 
                         + " does not match post-handler method " + 
                         postHandlerMethod);
                } 
            }
        } catch(Exception e) {
            logger.log(Level.WARNING, "postWebHandlerError", e);
            wsUtil.throwSOAPFaultException(e.getMessage(), context);
        }

        return true;