FileDocCategorySizeDatePackage
HTTPActionHandler.javaAPI DocApache Axis 1.43000Sat Apr 22 18:57:28 BST 2006org.apache.axis.handlers.http

HTTPActionHandler

public class HTTPActionHandler extends org.apache.axis.handlers.BasicHandler
An HTTPActionHandler simply sets the context's TargetService property from the HTTPAction property. We expect there to be a Router on the chain after us, to dispatch to the service named in the SOAPAction. In the real world, this might do some more complex mapping of SOAPAction to a TargetService.
author
Glen Daniels (gdaniels@allaire.com)
author
Doug Davis (dug@us.ibm.com)

Fields Summary
protected static Log
log
Constructors Summary
Methods Summary
public voidinvoke(org.apache.axis.MessageContext msgContext)


         
    
        log.debug("Enter: HTTPActionHandler::invoke");

        /** If there's already a targetService then just return.
         */
        if ( msgContext.getService() == null ) {
            String action = (String) msgContext.getSOAPActionURI();
            log.debug( "  HTTP SOAPAction: " + action );
            
            /** The idea is that this handler only goes in the chain IF this
            * service does a mapping between SOAPAction and target.  Therefore
            * if we get here with no action, we're in trouble.
            */
            if (action == null) {
                throw new AxisFault( "Server.NoHTTPSOAPAction",
                    Messages.getMessage("noSOAPAction00"),
                    null, null );
            }
            
            action = action.trim();

            // handle empty SOAPAction
            if (action.length() > 0 && action.charAt(0) == '\"") {
                // assertTrue(action.endsWith("\"")
                if (action.equals("\"\"")) {
                    action = "";
                } else {
                    action = action.substring(1, action.length() - 1);
                }
            }
            
            // if action is zero-length string, don't set anything
            if (action.length() > 0) {
                msgContext.setTargetService( action );
            }
        }

        log.debug("Exit: HTTPActionHandler::invoke");