Package org.apache.axis2.transport.http
Class SimpleHTTPServer
- java.lang.Object
-
- org.apache.axis2.transport.http.SimpleHTTPServer
-
- All Implemented Interfaces:
TransportListener
public class SimpleHTTPServer extends Object implements 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 ConfigurationContext
configurationContext
static int
DEFAULT_PORT
protected HttpFactory
httpFactory
static String
PARAM_PORT
-
Fields inherited from interface org.apache.axis2.kernel.TransportListener
HOST_ADDRESS
-
-
Constructor Summary
Constructors Constructor Description SimpleHTTPServer()
SimpleHTTPServer(ConfigurationContext configurationContext, int port)
Create a SimpleHTTPServer using default HttpFactory settingsSimpleHTTPServer(HttpFactory httpFactory)
Create a configured SimpleHTTPServer
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
ConfigurationContext
getConfigurationContext()
Method getConfigurationContextEndpointReference
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)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 httpFactorySessionContext
getSessionContext(MessageContext messageContext)
To get the sessionContext transport dependent manner.void
init(ConfigurationContext axisConf, TransportInDescription transprtIn)
init method in TransportListenerboolean
isRunning()
Checks if this HTTP server instance is running.static void
main(String[] args)
Method mainstatic 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 ConfigurationContext configurationContext
-
httpFactory
protected HttpFactory httpFactory
-
-
Constructor Detail
-
SimpleHTTPServer
public SimpleHTTPServer()
-
SimpleHTTPServer
public SimpleHTTPServer(ConfigurationContext configurationContext, int port) throws AxisFault
Create a SimpleHTTPServer using default HttpFactory settings- Throws:
AxisFault
-
SimpleHTTPServer
public SimpleHTTPServer(HttpFactory httpFactory) throws AxisFault
Create a configured SimpleHTTPServer- Throws:
AxisFault
-
-
Method Detail
-
init
public void init(ConfigurationContext axisConf, TransportInDescription transprtIn) throws AxisFault
init method in TransportListener- Specified by:
init
in interfaceTransportListener
- Parameters:
axisConf
-transprtIn
-- Throws:
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 AxisFault
Start this server as a NON-daemon.- Specified by:
start
in interfaceTransportListener
- Throws:
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 interfaceTransportListener
-
getEPRsForService
public EndpointReference[] getEPRsForService(String serviceName, String ip) throws 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 interfaceTransportListener
- Parameters:
serviceName
-ip
-- Returns:
- an EndpointReference
- Throws:
AxisFault
- See Also:
org.apache.axis2.kernel.TransportListener#getEPRForService(String,String)
-
getHttpFactory
public HttpFactory getHttpFactory()
Getter for httpFactory
-
getConfigurationContext
public ConfigurationContext getConfigurationContext()
Method getConfigurationContext- Returns:
- the system context
-
getEPRForService
public EndpointReference getEPRForService(String serviceName, String ip) throws 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:
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 SessionContext getSessionContext(MessageContext messageContext)
Description copied from interface:TransportListener
To get the sessionContext transport dependent manner. So that transport listener can return its own implementation of session managment- Specified by:
getSessionContext
in interfaceTransportListener
- Parameters:
messageContext
- : MessageContext which has all the relavent data- Returns:
- SessionContext
-
destroy
public void destroy()
- Specified by:
destroy
in interfaceTransportListener
-
-