Home » xml-commons-external-1.4.01-src » javax » xml » messaging » [javadoc | source]
abstract public class: JAXMServlet [javadoc | source]

All Implemented Interfaces:
    Serializable, Servlet, ServletConfig

The superclass for components that live in a servlet container that receives JAXM messages. A JAXMServlet object is notified of a message's arrival using the HTTP-SOAP binding.

The JAXMServlet class is a support/utility class and is provided purely as a convenience. It is not a mandatory component, and there is no requirement that it be implemented or extended.

Note that when a component that receives messages extends JAXMServlet, it also needs to implement either a ReqRespListener object or a OnewayListener object, depending on whether the component is written for a request-response style of interaction or for a one-way (asynchronous) style of interaction.
Field Summary
protected  MessageFactory msgFactory    The MessageFactory object that will be used internally to create the SOAPMessage object to be passed to the method onMessage. This new message will contain the data from the message that was posted to the servlet. Using the MessageFactory object that is the value for this field to create the new message ensures that the correct profile is used. 
Fields inherited from javax.servlet.http.HttpServlet:
Method from javax.xml.messaging.JAXMServlet Summary:
doPost,   getHeaders,   init,   putHeaders,   setMessageFactory
Methods from javax.servlet.http.HttpServlet:
class$,   doDelete,   doGet,   doHead,   doOptions,   doPost,   doPut,   doTrace,   getLastModified,   service,   service
Methods from javax.servlet.GenericServlet:
destroy,   getInitParameter,   getInitParameterNames,   getServletConfig,   getServletContext,   getServletInfo,   getServletName,   init,   init,   log,   log,   service
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.xml.messaging.JAXMServlet Detail:
 public  void doPost(HttpServletRequest req,
    HttpServletResponse resp) throws ServletException, IOException 
    Internalizes the given HttpServletRequest object and writes the reply to the given HttpServletResponse object.

    Note that the value for the msgFactory field will be used to internalize the message. This ensures that the message factory for the correct profile is used.

 protected static MimeHeaders getHeaders(HttpServletRequest req) 
    Returns a MimeHeaders object that contains the headers in the given HttpServletRequest object.
 public  void init(ServletConfig servletConfig) throws ServletException 
    Initializes this JAXMServlet object using the given ServletConfig object and initializing the msgFactory field with a default MessageFactory object.
 protected static  void putHeaders(MimeHeaders headers,
    HttpServletResponse res) 
    Sets the given HttpServletResponse object with the headers in the given MimeHeaders object.
 public  void setMessageFactory(MessageFactory msgFactory) 
    Sets this JAXMServlet object's msgFactory field with the given MessageFactory object. A MessageFactory object for a particular profile needs to be set before a message is received in order for the message to be successfully internalized.