Package org.apache.axis2.transport.http
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.ConfigurationContextconfigurationContextstatic intDEFAULT_PORTprotected HttpFactoryhttpFactorystatic StringPARAM_PORT
-
Constructor Summary
Constructors Constructor Description SimpleHTTPServer()SimpleHTTPServer(org.apache.axis2.context.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 voiddestroy()org.apache.axis2.context.ConfigurationContextgetConfigurationContext()Method getConfigurationContextorg.apache.axis2.addressing.EndpointReferencegetEPRForService(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)HttpFactorygetHttpFactory()Getter for httpFactoryorg.apache.axis2.context.SessionContextgetSessionContext(org.apache.axis2.context.MessageContext messageContext)voidinit(org.apache.axis2.context.ConfigurationContext axisConf, org.apache.axis2.description.TransportInDescription transprtIn)init method in TransportListenerbooleanisRunning()Checks if this HTTP server instance is running.static voidmain(String[] args)Method mainstatic voidprintUsage()voidstart()Start this server as a NON-daemon.voidstop()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
-
httpFactory
protected HttpFactory httpFactory
-
-
Constructor Detail
-
SimpleHTTPServer
public SimpleHTTPServer()
-
SimpleHTTPServer
public SimpleHTTPServer(org.apache.axis2.context.ConfigurationContext configurationContext, int port) throws org.apache.axis2.AxisFaultCreate 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.AxisFaultinit method in TransportListener- Specified by:
initin interfaceorg.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.AxisFaultStart this server as a NON-daemon.- Specified by:
startin interfaceorg.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:
stopin interfaceorg.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:
getEPRsForServicein interfaceorg.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:
getSessionContextin interfaceorg.apache.axis2.kernel.TransportListener
-
destroy
public void destroy()
- Specified by:
destroyin interfaceorg.apache.axis2.kernel.TransportListener
-
-