Class SimpleHTTPServer

java.lang.Object
org.apache.axis2.transport.http.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.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.apache.axis2.context.ConfigurationContext
     
    static int
     
    protected HttpFactory
     
    static String
     

    Fields inherited from interface org.apache.axis2.kernel.TransportListener

    HOST_ADDRESS
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    void
     
    org.apache.axis2.context.ConfigurationContext
    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)
    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
    Checks if this HTTP server instance is running.
    static void
    main(String[] args)
    Method main
    static void
     
    void
    Start this server as a NON-daemon.
    void
    Stop this server.

    Methods inherited from class java.lang.Object

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

    • DEFAULT_PORT

      public static int DEFAULT_PORT
    • PARAM_PORT

      public static String PARAM_PORT
    • configurationContext

      protected org.apache.axis2.context.ConfigurationContext configurationContext
    • httpFactory

      protected HttpFactory httpFactory
  • Constructor Details

    • 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 Details

    • 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
    • main

      public static void main(String[] args) throws Exception
      Method main
      Parameters:
      args -
      Throws:
      Exception
    • 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