Class AxisServlet

  • All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class AxisServlet
    extends AxisServletBase
    Author:
    Doug Davis (dug@us.ibm.com), Steve Loughran xdoclet tags are not active yet; keep web.xml in sync. To change the location of the services, change url-pattern in web.xml and set parameter axis.servicesPath in server-config.wsdd. For more information see Axis Reference Guide.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      AxisServlet()
      create a new servlet instance
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doGet​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Process GET requests.
      void doPost​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
      Process a POST to the servlet by handing it off to the Axis Engine.
      protected java.lang.String getDefaultJWSClassDir()
      Provided to allow overload of default JWSClassDir by derived class.
      protected int getHttpServletResponseStatus​(AxisFault af)
      Extract information from AxisFault and map it to a HTTP Status code.
      protected java.lang.String getJWSClassDir()  
      void init()
      Initialization method.
      void initQueryStringHandlers()
      Initialize a Handler for the transport defined in the Axis server config.
      protected void logException​(java.lang.Throwable e)
      log any exception to our output log, at our chosen level
      protected void processAxisFault​(AxisFault fault)
      routine called whenever an axis fault is caught; where they are logged and any other business.
      protected void reportAvailableServices​(javax.servlet.http.HttpServletResponse response, java.io.PrintWriter writer, javax.servlet.http.HttpServletRequest request)
      This method lists the available services; it is called when there is nothing to execute on a GET
      protected void reportCantGetAxisService​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.PrintWriter writer)
      generate the error response to indicate that there is apparently no endpoint there
      protected void reportCantGetJWSService​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.PrintWriter writer)
      probe for a JWS page and report 'no service' if one is not found there
      protected void reportNoWSDL​(javax.servlet.http.HttpServletResponse res, java.io.PrintWriter writer, java.lang.String moreDetailCode, AxisFault axisFault)
      report that we have no WSDL This method was moved to the querystring handler QSWSDLHandler.
      protected void reportServiceInfo​(javax.servlet.http.HttpServletResponse response, java.io.PrintWriter writer, SOAPService service, java.lang.String serviceName)
      print a snippet of service info.
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service
      • Methods inherited from class javax.servlet.GenericServlet

        getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, getServletName, init, log, log
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • log

        protected static org.apache.commons.logging.Log log
      • INIT_PROPERTY_TRANSPORT_NAME

        public static final java.lang.String INIT_PROPERTY_TRANSPORT_NAME
        See Also:
        Constant Field Values
      • INIT_PROPERTY_USE_SECURITY

        public static final java.lang.String INIT_PROPERTY_USE_SECURITY
        See Also:
        Constant Field Values
      • INIT_PROPERTY_ENABLE_LIST

        public static final java.lang.String INIT_PROPERTY_ENABLE_LIST
        See Also:
        Constant Field Values
      • INIT_PROPERTY_JWS_CLASS_DIR

        public static final java.lang.String INIT_PROPERTY_JWS_CLASS_DIR
        See Also:
        Constant Field Values
      • INIT_PROPERTY_DISABLE_SERVICES_LIST

        public static final java.lang.String INIT_PROPERTY_DISABLE_SERVICES_LIST
        See Also:
        Constant Field Values
      • INIT_PROPERTY_SERVICES_PATH

        public static final java.lang.String INIT_PROPERTY_SERVICES_PATH
        See Also:
        Constant Field Values
    • Constructor Detail

      • AxisServlet

        public AxisServlet()
        create a new servlet instance
    • Method Detail

      • getJWSClassDir

        protected java.lang.String getJWSClassDir()
      • init

        public void init()
                  throws javax.servlet.ServletException
        Initialization method.
        Overrides:
        init in class AxisServletBase
        Throws:
        javax.servlet.ServletException
      • doGet

        public void doGet​(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)
                   throws javax.servlet.ServletException,
                          java.io.IOException
        Process GET requests. This includes handoff of pseudo-SOAP requests
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Parameters:
        request - request in
        response - request out
        Throws:
        javax.servlet.ServletException
        java.io.IOException
      • processAxisFault

        protected void processAxisFault​(AxisFault fault)
        routine called whenever an axis fault is caught; where they are logged and any other business. The method may modify the fault in the process
        Parameters:
        fault - what went wrong.
      • logException

        protected void logException​(java.lang.Throwable e)
        log any exception to our output log, at our chosen level
        Parameters:
        e - what went wrong
      • reportServiceInfo

        protected void reportServiceInfo​(javax.servlet.http.HttpServletResponse response,
                                         java.io.PrintWriter writer,
                                         SOAPService service,
                                         java.lang.String serviceName)
        print a snippet of service info.
        Parameters:
        service - service
        writer - output channel
        serviceName - where to put stuff
      • reportNoWSDL

        protected void reportNoWSDL​(javax.servlet.http.HttpServletResponse res,
                                    java.io.PrintWriter writer,
                                    java.lang.String moreDetailCode,
                                    AxisFault axisFault)
        report that we have no WSDL This method was moved to the querystring handler QSWSDLHandler. The method reportNoWSDL in AxisServlet is never called. Perhaps the method is overwritten in subclasses of AxisServlet so the method wasn't removed. See the discussion in http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23845
        Parameters:
        res -
        writer -
        moreDetailCode - optional name of a message to provide more detail
        axisFault - optional fault string, for extra info at debug time only
      • reportAvailableServices

        protected void reportAvailableServices​(javax.servlet.http.HttpServletResponse response,
                                               java.io.PrintWriter writer,
                                               javax.servlet.http.HttpServletRequest request)
                                        throws ConfigurationException,
                                               AxisFault
        This method lists the available services; it is called when there is nothing to execute on a GET
        Parameters:
        response -
        writer -
        request -
        Throws:
        ConfigurationException
        AxisFault
      • reportCantGetAxisService

        protected void reportCantGetAxisService​(javax.servlet.http.HttpServletRequest request,
                                                javax.servlet.http.HttpServletResponse response,
                                                java.io.PrintWriter writer)
        generate the error response to indicate that there is apparently no endpoint there
        Parameters:
        request - the request that didnt have an edpoint
        response - response we are generating
        writer - open writer for the request
      • reportCantGetJWSService

        protected void reportCantGetJWSService​(javax.servlet.http.HttpServletRequest request,
                                               javax.servlet.http.HttpServletResponse response,
                                               java.io.PrintWriter writer)
        probe for a JWS page and report 'no service' if one is not found there
        Parameters:
        request - the request that didnt have an edpoint
        response - response we are generating
        writer - open writer for the request
      • doPost

        public void doPost​(javax.servlet.http.HttpServletRequest req,
                           javax.servlet.http.HttpServletResponse res)
                    throws javax.servlet.ServletException,
                           java.io.IOException
        Process a POST to the servlet by handing it off to the Axis Engine. Here is where SOAP messages are received
        Overrides:
        doPost in class javax.servlet.http.HttpServlet
        Parameters:
        req - posted request
        res - respose
        Throws:
        javax.servlet.ServletException - trouble
        java.io.IOException - different trouble
      • getHttpServletResponseStatus

        protected int getHttpServletResponseStatus​(AxisFault af)
        Extract information from AxisFault and map it to a HTTP Status code.
        Parameters:
        af - Axis Fault
        Returns:
        HTTP Status code.
      • getDefaultJWSClassDir

        protected java.lang.String getDefaultJWSClassDir()
        Provided to allow overload of default JWSClassDir by derived class.
        Returns:
        directory for JWS files
      • initQueryStringHandlers

        public void initQueryStringHandlers()
        Initialize a Handler for the transport defined in the Axis server config. This includes optionally filling in query string handlers.