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
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
FieldsModifier and TypeFieldDescriptionprotected org.apache.axis2.context.ConfigurationContextstatic intprotected HttpFactorystatic StringFields inherited from interface org.apache.axis2.kernel.TransportListener
HOST_ADDRESS -
Constructor Summary
ConstructorsConstructorDescriptionSimpleHTTPServer(org.apache.axis2.context.ConfigurationContext configurationContext, int port) Create a SimpleHTTPServer using default HttpFactory settingsSimpleHTTPServer(HttpFactory httpFactory) Create a configured SimpleHTTPServer -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()org.apache.axis2.context.ConfigurationContextMethod 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)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 TransportListenerbooleanChecks if this HTTP server instance is running.static voidMethod mainstatic voidvoidstart()Start this server as a NON-daemon.voidstop()Stop this server.
-
Field Details
-
DEFAULT_PORT
public static int DEFAULT_PORT -
PARAM_PORT
-
configurationContext
protected org.apache.axis2.context.ConfigurationContext configurationContext -
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
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:
initin interfaceorg.apache.axis2.kernel.TransportListener- Parameters:
axisConf-transprtIn-- Throws:
org.apache.axis2.AxisFault
-
main
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
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
-