org.codehaus.activesoap.handler
Class SoapRequestHandler

java.lang.Object
  extended byorg.codehaus.activesoap.handler.SoapRequestHandler
All Implemented Interfaces:
Handler, XMLStreamConstants

public class SoapRequestHandler
extends Object
implements Handler, XMLStreamConstants

A processor of a single SOAP request which is discarded after it has completed the request. This object parsers the SOAP envelope using StAX then delegates the processing of each header element and body element to a separate Handler, which will typically be XMLBeans but could be anything such as SAX, TrAX, XStream, JAXB, a JAX-RPC handler, Axis, XFire etc.

Version:
$Revision: 1.13 $

Field Summary
 
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
 
Constructor Summary
SoapRequestHandler(SoapService service, SoapVersion soap)
           
 
Method Summary
protected  void checkHeaderElementWritten(XMLStreamWriter out)
           
protected  XMLStreamWriter close(XMLStreamWriter out)
           
protected  void ensureClosed(XMLStreamWriter out)
           
protected  void fireOnComplete()
          lets notify the lifecycles of interested handlers
 Set getHandlersUsed()
           
protected  String getNameText(QName name)
          Returns the Qname as a name, typically as 'prefix:localPart' unless there is no prefix in which case just the 'localPart' is returned.
protected  void handleException(XMLStreamWriter out, Exception e)
           
protected  boolean hasRole(String role)
           
 void invoke(MessageExchange exchange)
          Handles the processing of an XML message which is typically a SOAP body element or header element but could be an entire REST XML service.
protected  boolean isNextRole(String role)
           
 boolean isStrict()
           
protected  boolean isTrue(String prefix, String value)
          Return true if the attribute is not null and contains 'true'
protected  boolean isUltimateReceiver(String role)
           
protected  void processBody(XMLStreamWriter out)
           
protected  void processHeaders(XMLStreamWriter out)
           
 void setStrict(boolean strict)
           
protected  void skipToElementStart(String expected)
           
protected  void skipToEndOfTag(QName name)
           
protected  boolean skipToHeader()
           
protected  void skipToStartBodyElement()
           
protected  void skipToStartElement(String expected)
           
protected  void validateEncodingStyle(String encodingStyle)
          Throws a SoapFault if the encoding style is not supported
protected  SoapFault validateEnvelope(String namespace)
           
protected  void writeFault(XMLStreamWriter out, SoapFault fault)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoapRequestHandler

public SoapRequestHandler(SoapService service,
                          SoapVersion soap)
Method Detail

invoke

public void invoke(MessageExchange exchange)
            throws Exception
Description copied from interface: Handler
Handles the processing of an XML message which is typically a SOAP body element or header element but could be an entire REST XML service.

Specified by:
invoke in interface Handler
Parameters:
exchange - is the message exchange which can be used to accesss message-specific attributes to communicate between different handlers in a loose coupled way or to access service specific details such as the SOAP roles and encodings etc.
Throws:
Exception

isStrict

public boolean isStrict()

setStrict

public void setStrict(boolean strict)

getHandlersUsed

public Set getHandlersUsed()

processHeaders

protected void processHeaders(XMLStreamWriter out)
                       throws Exception
Throws:
Exception

hasRole

protected boolean hasRole(String role)

isNextRole

protected boolean isNextRole(String role)

isUltimateReceiver

protected boolean isUltimateReceiver(String role)

validateEnvelope

protected SoapFault validateEnvelope(String namespace)

checkHeaderElementWritten

protected void checkHeaderElementWritten(XMLStreamWriter out)
                                  throws XMLStreamException
Throws:
XMLStreamException

processBody

protected void processBody(XMLStreamWriter out)
                    throws Exception
Throws:
Exception

fireOnComplete

protected void fireOnComplete()
                       throws Exception
lets notify the lifecycles of interested handlers

Throws:
Exception

validateEncodingStyle

protected void validateEncodingStyle(String encodingStyle)
                              throws SoapFault
Throws a SoapFault if the encoding style is not supported

Throws:
SoapFault

writeFault

protected void writeFault(XMLStreamWriter out,
                          SoapFault fault)
                   throws XMLStreamException
Throws:
XMLStreamException

handleException

protected void handleException(XMLStreamWriter out,
                               Exception e)
                        throws XMLStreamException
Throws:
XMLStreamException

getNameText

protected String getNameText(QName name)
Returns the Qname as a name, typically as 'prefix:localPart' unless there is no prefix in which case just the 'localPart' is returned.


ensureClosed

protected void ensureClosed(XMLStreamWriter out)

close

protected XMLStreamWriter close(XMLStreamWriter out)
                         throws XMLStreamException
Throws:
XMLStreamException

isTrue

protected boolean isTrue(String prefix,
                         String value)
                  throws SoapFault
Return true if the attribute is not null and contains 'true'

Throws:
SoapFault

skipToHeader

protected boolean skipToHeader()
                        throws XMLStreamException
Throws:
XMLStreamException

skipToStartBodyElement

protected void skipToStartBodyElement()
                               throws XMLStreamException,
                                      SoapFault
Throws:
XMLStreamException
SoapFault

skipToElementStart

protected void skipToElementStart(String expected)
                           throws XMLStreamException
Throws:
XMLStreamException

skipToStartElement

protected void skipToStartElement(String expected)
                           throws XMLStreamException
Throws:
XMLStreamException

skipToEndOfTag

protected void skipToEndOfTag(QName name)
                       throws XMLStreamException
Throws:
XMLStreamException


Copyright © 2004-2007 LogicBlaze, Inc.. All Rights Reserved.