## org.apache.axis.transport.http
Class AxisServlet

    java.lang.Object
      |
      +--javax.servlet.GenericServlet
            |
            +--javax.servlet.http.HttpServlet
                  |
                  +--org.apache.axis.transport.http.AxisServletBase
                        |
                        +--org.apache.axis.transport.http.AxisServlet

All Implemented Interfaces:
  java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class AxisServlet
extends AxisServletBase

Author:
  Doug Davis (dug@us.ibm.com), Steve Loughran xdoclet tags are not active yet; keep web.xml in sync
See Also:
  Serialized Form

Field Summary
`static java.lang.String` `INIT_PROPERTY_ENABLE_LIST`
`static java.lang.String` `INIT_PROPERTY_JWS_CLASS_DIR`
`static java.lang.String` `INIT_PROPERTY_TRANSPORT_NAME`
`static java.lang.String` `INIT_PROPERTY_USE_SECURITY`
`protected static org.apache.commons.logging.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(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` Process GET requests.
`void` `doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)` Process a POST to the servlet by handing it off to the Axis Engine.
`protected java.lang.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 java.lang.String` `getJWSClassDir()`
`protected java.lang.String` `getProtocolVersion(javax.servlet.http.HttpServletRequest req)` Return the HTTP protocol level 1.1 or 1.0 by derived class.
`void` `init()` Initialization method.
`protected void` `invokeEndpointFromGet(MessageContext msgContext, javax.servlet.http.HttpServletResponse response, java.io.PrintWriter writer, java.lang.String method, java.lang.String args)` invoke an endpoint from a get request by building an XML request and handing it down.
`protected void` `logException(java.lang.Exception 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` `processListRequest(javax.servlet.http.HttpServletResponse response, java.io.PrintWriter writer)` respond to the ?list command.
`protected void` `processMethodRequest(MessageContext msgContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.PrintWriter writer)` scan through the request for parameters, invoking the endpoint if we get a method param.
`protected void` `processWsdlRequest(MessageContext msgContext, javax.servlet.http.HttpServletResponse response, java.io.PrintWriter writer)` handle a ?wsdl request
`protected void` `reportAvailableServices(javax.servlet.http.HttpServletResponse response, java.io.PrintWriter writer, javax.servlet.http.HttpServletRequest request)` This method lists the available services; it is called when there is nothing to execute on a GET
`protected void` `reportCantGetAxisService(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.PrintWriter writer)` generate the error response to indicate that there is apparently no endpoint there
`protected void` `reportCantGetJWSService(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.PrintWriter writer)` probe for a JWS page and report 'no service' if one is not found there
`protected void` `reportNoWSDL(javax.servlet.http.HttpServletResponse res, java.io.PrintWriter writer, java.lang.String moreDetailCode, AxisFault axisFault)` report that we have no WSDL
`protected void` `reportServiceInfo(javax.servlet.http.HttpServletResponse response, java.io.PrintWriter writer, SOAPService service, java.lang.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, getWebappBase, getWebInfPath, incLockCounter, isDevelopment, service`

Methods inherited from class javax.servlet.http.HttpServlet
`doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service`

Methods inherited from class javax.servlet.GenericServlet
`getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, getServletName, init, log, log`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### log

    protected static org.apache.commons.logging.Log log

### INIT_PROPERTY_TRANSPORT_NAME

    public static final java.lang.String INIT_PROPERTY_TRANSPORT_NAME

See Also:
  Constant Field Values

### INIT_PROPERTY_USE_SECURITY

    public static final java.lang.String INIT_PROPERTY_USE_SECURITY

See Also:
  Constant Field Values

### INIT_PROPERTY_ENABLE_LIST

    public static final java.lang.String INIT_PROPERTY_ENABLE_LIST

See Also:
  Constant Field Values

### INIT_PROPERTY_JWS_CLASS_DIR

    public static final java.lang.String INIT_PROPERTY_JWS_CLASS_DIR

See Also:
  Constant Field Values

Constructor Detail

### AxisServlet

    public AxisServlet()

  create a new servlet instance

Method Detail

### getJWSClassDir

    protected java.lang.String getJWSClassDir()

### init

    public void init()

  Initialization method.

  Overrides:
    `init` in class `AxisServletBase`

### doGet

    public void doGet(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      java.io.IOException

  Process GET requests. This includes handoff of pseudo-SOAP requests

  Overrides:
    `doGet` in class `javax.servlet.http.HttpServlet`
  Parameters:
    `request` - request in
    `response` - request out
  Throws:
    `javax.servlet.ServletException`
    `java.io.IOException`

### 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.

### logException

    protected void logException(java.lang.Exception e)

  log any exception to our output log, at our chosen level

  Parameters:
    `e` - what went wrong

### processMethodRequest

    protected void processMethodRequest(MessageContext msgContext,
                                        javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response,
                                        java.io.PrintWriter writer)
                                 throws AxisFault

  scan through the request for parameters, invoking the endpoint if we get a method param. If there was no method param then the response is set to a 400 Bad Request and some error text

  Parameters:
    `msgContext` - current message
    `request` - incoming requests
    `response` - response to generate
    `writer` - output stream
  Throws:
    `AxisFault` - if anything goes wrong during method execution

### processWsdlRequest

    protected void processWsdlRequest(MessageContext msgContext,
                                      javax.servlet.http.HttpServletResponse response,
                                      java.io.PrintWriter writer)
                               throws AxisFault

  handle a ?wsdl request

  Parameters:
    `msgContext` - message context so far
    `response` - response to write to
    `writer` - output stream
  Throws:
    `AxisFault` - when anything other than a Server.NoService fault is reported during WSDL generation

### invokeEndpointFromGet

    protected void invokeEndpointFromGet(MessageContext msgContext,
                                         javax.servlet.http.HttpServletResponse response,
                                         java.io.PrintWriter writer,
                                         java.lang.String method,
                                         java.lang.String args)
                                  throws AxisFault

  invoke an endpoint from a get request by building an XML request and handing it down. If anything goes wrong, we generate an XML formatted axis fault

  Parameters:
    `msgContext` - current message
    `response` - to return data
    `writer` - output stream
    `method` - method to invoke (may be null)
    `args` - argument list in XML form
  Throws:
    `AxisFault` - iff something goes wrong when turning the response message into a SOAP string.

### reportServiceInfo

    protected void reportServiceInfo(javax.servlet.http.HttpServletResponse response,
                                     java.io.PrintWriter writer,
                                     SOAPService service,
                                     java.lang.String serviceName)

  print a snippet of service info.

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

### processListRequest

    protected void processListRequest(javax.servlet.http.HttpServletResponse response,
                                      java.io.PrintWriter writer)
                               throws AxisFault

  respond to the ?list command. if enableList is set, we list the engine config. If it isnt, then an error is written out

  Parameters:
    `response` -
    `writer` -
  Throws:
    `AxisFault`

### reportNoWSDL

    protected void reportNoWSDL(javax.servlet.http.HttpServletResponse res,
                                java.io.PrintWriter writer,
                                java.lang.String moreDetailCode,
                                AxisFault axisFault)

  report that we have no WSDL

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

### reportAvailableServices

    protected void reportAvailableServices(javax.servlet.http.HttpServletResponse response,
                                           java.io.PrintWriter writer,
                                           javax.servlet.http.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(javax.servlet.http.HttpServletRequest request,
                                            javax.servlet.http.HttpServletResponse response,
                                            java.io.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(javax.servlet.http.HttpServletRequest request,
                                           javax.servlet.http.HttpServletResponse response,
                                           java.io.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

### doPost

    public void doPost(javax.servlet.http.HttpServletRequest req,
                       javax.servlet.http.HttpServletResponse res)
                throws javax.servlet.ServletException,
                       java.io.IOException

  Process a POST to the servlet by handing it off to the Axis Engine. Here is where SOAP messages are received

  Overrides:
    `doPost` in class `javax.servlet.http.HttpServlet`
  Parameters:
    `req` - posted request
    `res` - respose
  Throws:
    `javax.servlet.ServletException` - trouble
    `java.io.IOException` - different trouble

### 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.

### getDefaultJWSClassDir

    protected java.lang.String getDefaultJWSClassDir()

  Provided to allow overload of default JWSClassDir by derived class.

  Returns:
    directory for JWS files

### getProtocolVersion

    protected java.lang.String getProtocolVersion(javax.servlet.http.HttpServletRequest req)

  Return the HTTP protocol level 1.1 or 1.0 by derived class.

  Returns:
    one of the HTTPConstants values

Copyright © 2003 Apache Web Services Project. All Rights Reserved.