Class AxisServlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
    Direct Known Subclasses:
    AxisAdminServlet

    public class AxisServlet
    extends javax.servlet.http.HttpServlet
    Servlet implementing the HTTP and HTTPS transport. Note that this class doesn't implement TransportListener. There are two reasons for this: The TransportListener implementation is provided by AxisServletListener. An instance of that class must be declared in axis2.xml for each protocol (HTTP/HTTPS) that the servlet should accept.
    See Also:
    Serialized Form
    • Constructor Detail

      • AxisServlet

        public AxisServlet()
    • Method Detail

      • doPost

        protected void doPost​(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws javax.servlet.ServletException,
                              IOException
        Implementaion of POST interface
        Overrides:
        doPost in class javax.servlet.http.HttpServlet
        Parameters:
        request -
        response -
        Throws:
        javax.servlet.ServletException
        IOException
      • doGet

        protected void doGet​(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws javax.servlet.ServletException,
                             IOException
        Implementation for GET interface
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Parameters:
        request -
        response -
        Throws:
        javax.servlet.ServletException
        IOException
      • doDelete

        protected void doDelete​(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
                         throws javax.servlet.ServletException,
                                IOException
        Implementation of DELETE interface
        Overrides:
        doDelete in class javax.servlet.http.HttpServlet
        Parameters:
        request -
        response -
        Throws:
        javax.servlet.ServletException
        IOException
      • doPut

        protected void doPut​(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws javax.servlet.ServletException,
                             IOException
        Implementation of PUT interface
        Overrides:
        doPut in class javax.servlet.http.HttpServlet
        Parameters:
        request -
        response -
        Throws:
        javax.servlet.ServletException
        IOException
      • showRestDisabledErrorMessage

        protected void showRestDisabledErrorMessage​(javax.servlet.http.HttpServletResponse response)
                                             throws IOException
        Private method that deals with disabling of REST support.
        Parameters:
        response -
        Throws:
        IOException
      • init

        public void init​(javax.servlet.ServletConfig config)
                  throws javax.servlet.ServletException
        Main init method
        Specified by:
        init in interface javax.servlet.Servlet
        Overrides:
        init in class javax.servlet.GenericServlet
        Parameters:
        config - The ServletConfig
        Throws:
        javax.servlet.ServletException
      • initGetRequestProcessors

        protected void initGetRequestProcessors​(javax.servlet.ServletConfig config)
        Initialize HTTP GET request processors
        Parameters:
        config - The ServletConfig of this Servlet
      • initTransports

        protected void initTransports()
                               throws AxisFault
        Initialize HTTP transports
        Throws:
        AxisFault - If an error occurs while initializing transports
      • destroy

        public void destroy()
        distroy the ConfigurationContext
        Specified by:
        destroy in interface javax.servlet.Servlet
        Overrides:
        destroy in class javax.servlet.GenericServlet
      • initParams

        protected void initParams()
        Initializes the Axis2 parameters.
      • init

        public void init()
                  throws javax.servlet.ServletException
        Convenient method to re-initialize the ConfigurationContext
        Overrides:
        init in class javax.servlet.GenericServlet
        Throws:
        javax.servlet.ServletException
      • initConfigContext

        protected ConfigurationContext initConfigContext​(javax.servlet.ServletConfig config)
                                                  throws javax.servlet.ServletException
        Initialize the Axis configuration context
        Parameters:
        config - Servlet configuration
        Returns:
        ConfigurationContext
        Throws:
        javax.servlet.ServletException
      • initContextRoot

        public void initContextRoot​(javax.servlet.http.HttpServletRequest req)
        Set the context root if it is not set already.
        Parameters:
        req -
      • getTransportHeaders

        protected Map<String,​String> getTransportHeaders​(javax.servlet.http.HttpServletRequest req)
        Get all transport headers.
        Parameters:
        req -
        Returns:
        Map
      • createMessageContext

        protected MessageContext createMessageContext​(javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response,
                                                      boolean invocationType)
                                               throws IOException
        Parameters:
        request -
        response -
        invocationType - : If invocationType=true; then this will be used in SOAP message invocation. If invocationType=false; then this will be used in REST message invocation.
        Returns:
        MessageContext
        Throws:
        IOException
      • createMessageContext

        protected MessageContext createMessageContext​(javax.servlet.http.HttpServletRequest req,
                                                      javax.servlet.http.HttpServletResponse resp)
                                               throws IOException
        This method assumes, that the created MessageContext will be used in only SOAP invocation.
        Parameters:
        req -
        resp -
        Returns:
        MessageContext
        Throws:
        IOException