org.codehaus.xfire.soap
Class SoapHandler

java.lang.Object
  extended by org.codehaus.xfire.AbstractXFireComponent
      extended by org.codehaus.xfire.handler.AbstractHandler
          extended by org.codehaus.xfire.soap.SoapHandler
All Implemented Interfaces:
Handler

public class SoapHandler
extends AbstractHandler

Processes SOAP invocations. The process is as follows:

TODO: outline what happens when a fault occurrs.

Since:
Oct 28, 2004
Author:
Dan Diephouse

Field Summary
 
Fields inherited from class org.codehaus.xfire.handler.AbstractHandler
STAX_WRITER_KEY
 
Fields inherited from interface org.codehaus.xfire.handler.Handler
ROLE
 
Constructor Summary
SoapHandler(EndpointHandler bodyHandler)
           
 
Method Summary
protected  void assertUnderstandsHeader(MessageContext context, javax.xml.namespace.QName name)
          Assert that a service understands a particular header.
protected  void createResponseHeader(MessageContext context)
           
 void handleFault(XFireFault fault, MessageContext context)
          Handles faults that occur in this handler.
 void invoke(MessageContext context)
          Invoke the Header and Body Handlers for the SOAP message.
protected  void invokePipeline(HandlerPipeline pipeline, java.util.Stack handlerStack, MessageContext context)
           
protected  void invokeRequestPipeline(java.util.Stack handlerStack, MessageContext context)
           
protected  void invokeResponsePipeline(java.util.Stack handlerStack, MessageContext context)
           
protected  void readHeaders(MessageContext context)
          Read in the headers as a YOM Element and create a response Header.
protected  void validateHeaders(MessageContext context)
          Validates that the mustUnderstand and role headers are processed correctly.
protected  void writeHeaders(MessageContext context, javax.xml.stream.XMLStreamWriter writer)
           
protected  void writeResponse(MessageContext context, java.lang.String encoding, java.util.Stack handlerStack)
          Create a response envelope and write the response message.
 
Methods inherited from class org.codehaus.xfire.handler.AbstractHandler
getRoles, getUnderstoodHeaders, getXMLStreamWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoapHandler

public SoapHandler(EndpointHandler bodyHandler)
Method Detail

invoke

public void invoke(MessageContext context)
            throws java.lang.Exception
Invoke the Header and Body Handlers for the SOAP message.

Throws:
java.lang.Exception

writeResponse

protected void writeResponse(MessageContext context,
                             java.lang.String encoding,
                             java.util.Stack handlerStack)
                      throws java.lang.Exception
Create a response envelope and write the response message.

Parameters:
context -
encoding -
handlerStack -
Throws:
java.lang.Exception

handleFault

public void handleFault(XFireFault fault,
                        MessageContext context)
Description copied from interface: Handler
Handles faults that occur in this handler. This is not responsible for actually writing the fault response message.

Specified by:
handleFault in interface Handler
Overrides:
handleFault in class AbstractHandler
See Also:
org.codehaus.xfire.handler.Handler#handleFault(java.lang.Exception, org.codehaus.xfire.MessageContext)

invokeRequestPipeline

protected void invokeRequestPipeline(java.util.Stack handlerStack,
                                     MessageContext context)
                              throws java.lang.Exception
Throws:
java.lang.Exception

invokeResponsePipeline

protected void invokeResponsePipeline(java.util.Stack handlerStack,
                                      MessageContext context)
                               throws java.lang.Exception
Throws:
java.lang.Exception

invokePipeline

protected void invokePipeline(HandlerPipeline pipeline,
                              java.util.Stack handlerStack,
                              MessageContext context)
                       throws java.lang.Exception
Throws:
java.lang.Exception

readHeaders

protected void readHeaders(MessageContext context)
                    throws javax.xml.stream.XMLStreamException
Read in the headers as a YOM Element and create a response Header.

Parameters:
context -
Throws:
javax.xml.stream.XMLStreamException

createResponseHeader

protected void createResponseHeader(MessageContext context)

validateHeaders

protected void validateHeaders(MessageContext context)
                        throws XFireFault
Validates that the mustUnderstand and role headers are processed correctly.

Parameters:
context -
Throws:
XFireFault

assertUnderstandsHeader

protected void assertUnderstandsHeader(MessageContext context,
                                       javax.xml.namespace.QName name)
                                throws XFireFault
Assert that a service understands a particular header. If not, a fault is thrown.

Parameters:
context -
name -
Throws:
XFireFault

writeHeaders

protected void writeHeaders(MessageContext context,
                            javax.xml.stream.XMLStreamWriter writer)
                     throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException