Class SimpleHTTPServer

  • All Implemented Interfaces:
    org.apache.axis2.kernel.TransportListener

    public class SimpleHTTPServer
    extends Object
    implements org.apache.axis2.kernel.TransportListener
    This is a simple implementation of an HTTP server for processing SOAP requests via Apache's xml-axis2. It can be used with no configuration other than the port to listen on, or it can be configured in detail with an HttpFactory.
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleHTTPServer()  
      SimpleHTTPServer​(org.apache.axis2.context.ConfigurationContext configurationContext, int port)
      Create a SimpleHTTPServer using default HttpFactory settings
      SimpleHTTPServer​(HttpFactory httpFactory)
      Create a configured SimpleHTTPServer
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()  
      org.apache.axis2.context.ConfigurationContext getConfigurationContext()
      Method getConfigurationContext
      org.apache.axis2.addressing.EndpointReference getEPRForService​(String serviceName, String ip)
      replyToEPR If the user has given host address paramter then it gets the high priority and ERP will be creatd using that N:B - hostAddress should be a complte url (http://www.myApp.com/ws)
      org.apache.axis2.addressing.EndpointReference[] getEPRsForService​(String serviceName, String ip)
      replyToEPR If the user has given host address paramter then it gets the high priority and ERP will be creatd using that N:B - hostAddress should be a complete url (http://www.myApp.com/ws)
      HttpFactory getHttpFactory()
      Getter for httpFactory
      org.apache.axis2.context.SessionContext getSessionContext​(org.apache.axis2.context.MessageContext messageContext)  
      void init​(org.apache.axis2.context.ConfigurationContext axisConf, org.apache.axis2.description.TransportInDescription transprtIn)
      init method in TransportListener
      boolean isRunning()
      Checks if this HTTP server instance is running.
      static void main​(String[] args)
      Method main
      static void printUsage()  
      void start()
      Start this server as a NON-daemon.
      void stop()
      Stop this server.
    • Field Detail

      • DEFAULT_PORT

        public static int DEFAULT_PORT
      • PARAM_PORT

        public static String PARAM_PORT
      • configurationContext

        protected org.apache.axis2.context.ConfigurationContext configurationContext
    • Constructor Detail

      • SimpleHTTPServer

        public SimpleHTTPServer()
      • SimpleHTTPServer

        public SimpleHTTPServer​(org.apache.axis2.context.ConfigurationContext configurationContext,
                                int port)
                         throws org.apache.axis2.AxisFault
        Create a SimpleHTTPServer using default HttpFactory settings
        Throws:
        org.apache.axis2.AxisFault
      • SimpleHTTPServer

        public SimpleHTTPServer​(HttpFactory httpFactory)
                         throws org.apache.axis2.AxisFault
        Create a configured SimpleHTTPServer
        Throws:
        org.apache.axis2.AxisFault
    • Method Detail

      • init

        public void init​(org.apache.axis2.context.ConfigurationContext axisConf,
                         org.apache.axis2.description.TransportInDescription transprtIn)
                  throws org.apache.axis2.AxisFault
        init method in TransportListener
        Specified by:
        init in interface org.apache.axis2.kernel.TransportListener
        Parameters:
        axisConf -
        transprtIn -
        Throws:
        org.apache.axis2.AxisFault
      • printUsage

        public static void printUsage()
      • start

        public void start()
                   throws org.apache.axis2.AxisFault
        Start this server as a NON-daemon.
        Specified by:
        start in interface org.apache.axis2.kernel.TransportListener
        Throws:
        org.apache.axis2.AxisFault
      • stop

        public void stop()
        Stop this server. Can be called safely if the system is already stopped, or if it was never started. This will interrupt any pending accept().
        Specified by:
        stop in interface org.apache.axis2.kernel.TransportListener
      • getEPRsForService

        public org.apache.axis2.addressing.EndpointReference[] getEPRsForService​(String serviceName,
                                                                                 String ip)
                                                                          throws org.apache.axis2.AxisFault
        replyToEPR If the user has given host address paramter then it gets the high priority and ERP will be creatd using that N:B - hostAddress should be a complete url (http://www.myApp.com/ws)
        Specified by:
        getEPRsForService in interface org.apache.axis2.kernel.TransportListener
        Parameters:
        serviceName -
        ip -
        Returns:
        an EndpointReference
        Throws:
        org.apache.axis2.AxisFault
        See Also:
        org.apache.axis2.kernel.TransportListener#getEPRForService(String,String)
      • getHttpFactory

        public HttpFactory getHttpFactory()
        Getter for httpFactory
      • getConfigurationContext

        public org.apache.axis2.context.ConfigurationContext getConfigurationContext()
        Method getConfigurationContext
        Returns:
        the system context
      • getEPRForService

        public org.apache.axis2.addressing.EndpointReference getEPRForService​(String serviceName,
                                                                              String ip)
                                                                       throws org.apache.axis2.AxisFault
        replyToEPR If the user has given host address paramter then it gets the high priority and ERP will be creatd using that N:B - hostAddress should be a complte url (http://www.myApp.com/ws)
        Parameters:
        serviceName -
        ip -
        Returns:
        an EndpointReference
        Throws:
        org.apache.axis2.AxisFault
        See Also:
        org.apache.axis2.kernel.TransportListener#getEPRForService(String,String)
      • isRunning

        public boolean isRunning()
        Checks if this HTTP server instance is running.
        Returns:
        true/false
      • getSessionContext

        public org.apache.axis2.context.SessionContext getSessionContext​(org.apache.axis2.context.MessageContext messageContext)
        Specified by:
        getSessionContext in interface org.apache.axis2.kernel.TransportListener
      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.apache.axis2.kernel.TransportListener