org.apache.axis.transport.http

Class AxisServlet


public class AxisServlet
extends AxisServletBase

Authors:
Doug Davis (dug@us.ibm.com)
Steve Loughran xdoclet tags are not active yet; keep web.xml in sync. To change the location of the services, change url-pattern in web.xml and set parameter axis.servicesPath in server-config.wsdd. For more information see Axis Reference Guide.

Field Summary

static String
INIT_PROPERTY_DISABLE_SERVICES_LIST
static String
INIT_PROPERTY_ENABLE_LIST
static String
INIT_PROPERTY_JWS_CLASS_DIR
static String
INIT_PROPERTY_SERVICES_PATH
static String
INIT_PROPERTY_TRANSPORT_NAME
static String
INIT_PROPERTY_USE_SECURITY
protected static Log
log

Fields inherited from class org.apache.axis.transport.http.AxisServletBase

ATTR_AXIS_ENGINE, axisServer

Constructor Summary

AxisServlet()
create a new servlet instance

Method Summary

void
doGet(HttpServletRequest request, HttpServletResponse response)
Process GET requests.
void
doPost(HttpServletRequest req, HttpServletResponse res)
Process a POST to the servlet by handing it off to the Axis Engine.
protected String
getDefaultJWSClassDir()
Provided to allow overload of default JWSClassDir by derived class.
protected int
getHttpServletResponseStatus(AxisFault af)
Extract information from AxisFault and map it to a HTTP Status code.
protected String
getJWSClassDir()
void
init()
Initialization method.
void
initQueryStringHandlers()
Initialize a Handler for the transport defined in the Axis server config.
protected void
logException(Throwable e)
log any exception to our output log, at our chosen level
protected void
processAxisFault(AxisFault fault)
routine called whenever an axis fault is caught; where they are logged and any other business.
protected void
reportAvailableServices(HttpServletResponse response, PrintWriter writer, HttpServletRequest request)
This method lists the available services; it is called when there is nothing to execute on a GET
protected void
reportCantGetAxisService(HttpServletRequest request, HttpServletResponse response, PrintWriter writer)
generate the error response to indicate that there is apparently no endpoint there
protected void
reportCantGetJWSService(HttpServletRequest request, HttpServletResponse response, PrintWriter writer)
probe for a JWS page and report 'no service' if one is not found there
protected void
reportNoWSDL(HttpServletResponse res, PrintWriter writer, String moreDetailCode, AxisFault axisFault)
report that we have no WSDL This method was moved to the querystring handler QSWSDLHandler.
protected void
reportServiceInfo(HttpServletResponse response, PrintWriter writer, SOAPService service, String serviceName)
print a snippet of service info.

Methods inherited from class org.apache.axis.transport.http.AxisServletBase

decLockCounter, destroy, getEngine, getEngine, getEngineEnvironment, getHomeDir, getLoadCounter, getOption, getServletContext, getWebInfPath, getWebappBase, incLockCounter, init, isDevelopment, service

Field Details

INIT_PROPERTY_DISABLE_SERVICES_LIST

public static final String INIT_PROPERTY_DISABLE_SERVICES_LIST


INIT_PROPERTY_ENABLE_LIST

public static final String INIT_PROPERTY_ENABLE_LIST


INIT_PROPERTY_JWS_CLASS_DIR

public static final String INIT_PROPERTY_JWS_CLASS_DIR


INIT_PROPERTY_SERVICES_PATH

public static final String INIT_PROPERTY_SERVICES_PATH


INIT_PROPERTY_TRANSPORT_NAME

public static final String INIT_PROPERTY_TRANSPORT_NAME


INIT_PROPERTY_USE_SECURITY

public static final String INIT_PROPERTY_USE_SECURITY


log

protected static Log log

Constructor Details

AxisServlet

public AxisServlet()
create a new servlet instance

Method Details

doGet

public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
            throws ServletException,
                   IOException
Process GET requests. This includes handoff of pseudo-SOAP requests

Parameters:
request - request in
response - request out


doPost

public void doPost(HttpServletRequest req,
                   HttpServletResponse res)
            throws ServletException,
                   IOException
Process a POST to the servlet by handing it off to the Axis Engine. Here is where SOAP messages are received

Parameters:
req - posted request
res - respose


getDefaultJWSClassDir

protected String getDefaultJWSClassDir()
Provided to allow overload of default JWSClassDir by derived class.

Returns:
directory for JWS files


getHttpServletResponseStatus

protected int getHttpServletResponseStatus(AxisFault af)
Extract information from AxisFault and map it to a HTTP Status code.

Parameters:
af - Axis Fault

Returns:
HTTP Status code.


getJWSClassDir

protected String getJWSClassDir()


init

public void init()
            throws javax.servlet.ServletException
Initialization method.
Overrides:
init in interface AxisServletBase


initQueryStringHandlers

public void initQueryStringHandlers()
Initialize a Handler for the transport defined in the Axis server config. This includes optionally filling in query string handlers.


logException

protected void logException(Throwable e)
log any exception to our output log, at our chosen level

Parameters:
e - what went wrong


processAxisFault

protected void processAxisFault(AxisFault fault)
routine called whenever an axis fault is caught; where they are logged and any other business. The method may modify the fault in the process

Parameters:
fault - what went wrong.


reportAvailableServices

protected void reportAvailableServices(HttpServletResponse response,
                                       PrintWriter writer,
                                       HttpServletRequest request)
            throws ConfigurationException,
                   AxisFault
This method lists the available services; it is called when there is nothing to execute on a GET

Parameters:
response -
writer -
request -

Throws:
ConfigurationException -
AxisFault -


reportCantGetAxisService

protected void reportCantGetAxisService(HttpServletRequest request,
                                        HttpServletResponse response,
                                        PrintWriter writer)
generate the error response to indicate that there is apparently no endpoint there

Parameters:
request - the request that didnt have an edpoint
response - response we are generating
writer - open writer for the request


reportCantGetJWSService

protected void reportCantGetJWSService(HttpServletRequest request,
                                       HttpServletResponse response,
                                       PrintWriter writer)
probe for a JWS page and report 'no service' if one is not found there

Parameters:
request - the request that didnt have an edpoint
response - response we are generating
writer - open writer for the request


reportNoWSDL

protected void reportNoWSDL(HttpServletResponse res,
                            PrintWriter writer,
                            String moreDetailCode,
                            AxisFault axisFault)
report that we have no WSDL This method was moved to the querystring handler QSWSDLHandler. The method reportNoWSDL in AxisServlet is never called. Perhaps the method is overwritten in subclasses of AxisServlet so the method wasn't removed. See the discussion in http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23845

Parameters:
res -
writer -
moreDetailCode - optional name of a message to provide more detail
axisFault - optional fault string, for extra info at debug time only


reportServiceInfo

protected void reportServiceInfo(HttpServletResponse response,
                                 PrintWriter writer,
                                 SOAPService service,
                                 String serviceName)
print a snippet of service info.

Parameters:
writer - output channel
service - service
serviceName - where to put stuff


Copyright B) 2005 Apache Web Services Project. All Rights Reserved.