Spring Web Services Framework

org.springframework.ws.server.endpoint
Class AbstractDom4jPayloadEndpoint

java.lang.Object
  extended by org.springframework.xml.transform.TransformerObjectSupport
      extended by org.springframework.ws.server.endpoint.AbstractDom4jPayloadEndpoint
All Implemented Interfaces:
PayloadEndpoint

public abstract class AbstractDom4jPayloadEndpoint
extends TransformerObjectSupport
implements PayloadEndpoint

Abstract base class for endpoints that handle the message payload as dom4j elements. Offers the message payload as a dom4j Element, and allows subclasses to create a response by returning an Element.

An AbstractDom4JPayloadEndpoint only accept one payload element. Multiple payload elements are not in accordance with WS-I.

Since:
1.0.0
Author:
Arjen Poutsma
See Also:
Element

Field Summary
 
Fields inherited from class org.springframework.xml.transform.TransformerObjectSupport
logger
 
Constructor Summary
AbstractDom4jPayloadEndpoint()
           
 
Method Summary
 Source invoke(Source request)
          Invokes the endpoint with the given request payload, and possibly returns a response.
protected abstract  Element invokeInternal(Element requestElement, Document responseDocument)
          Template method.
 
Methods inherited from class org.springframework.xml.transform.TransformerObjectSupport
createTransformer, getTransformerFactory, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDom4jPayloadEndpoint

public AbstractDom4jPayloadEndpoint()
Method Detail

invoke

public final Source invoke(Source request)
                    throws Exception
Description copied from interface: PayloadEndpoint
Invokes the endpoint with the given request payload, and possibly returns a response.

Specified by:
invoke in interface PayloadEndpoint
Parameters:
request - the payload of the request message, may be null
Returns:
the payload of the response message, may be null to indicate no response
Throws:
Exception - if an exception occurs

invokeInternal

protected abstract Element invokeInternal(Element requestElement,
                                          Document responseDocument)
                                   throws Exception
Template method. Subclasses must implement this. Offers the request payload as a dom4j Element, and allows subclasses to return a response Element.

The given dom4j Document is to be used for constructing a response element, by using addElement.

Parameters:
requestElement - the contents of the SOAP message as dom4j elements
responseDocument - a dom4j document to be used for constructing a response
Returns:
the response element. Can be null to specify no response.
Throws:
Exception

Spring Web Services Framework

Copyright � 2005-2008 The Spring Web Services Framework. All Rights Reserved.