Spring Web Services Framework

org.springframework.ws.soap.axiom
Class AxiomSoapMessageFactory

java.lang.Object
  extended by org.springframework.ws.soap.axiom.AxiomSoapMessageFactory
All Implemented Interfaces:
InitializingBean, SoapMessageFactory, WebServiceMessageFactory

public class AxiomSoapMessageFactory
extends Object
implements SoapMessageFactory, InitializingBean

Axiom-specific implementation of the WebServiceMessageFactory interface. Creates AxiomSoapMessages.

To increase reading performance on the the SOAP request created by this message context factory, you can set the payloadCaching property to false (default is true). This this will read the contents of the body directly from the stream. However, when this setting is enabled, the payload can only be read once. This means that any endpoint mappings or interceptors which are based on the message payload (such as the PayloadRootQNameEndpointMapping, the PayloadValidatingInterceptor, or the PayloadLoggingInterceptor) cannot be used. Instead, use an endpoint mapping that does not consume the payload (i.e. the SoapActionEndpointMapping).

Mostly derived from org.apache.axis2.transport.http.HTTPTransportUtils and org.apache.axis2.transport.TransportUtils, which we cannot use since they are not part of the Axiom distribution.

Since:
1.0.0
Author:
Arjen Poutsma
See Also:
AxiomSoapMessage, setPayloadCaching(boolean)

Constructor Summary
AxiomSoapMessageFactory()
          Default constructor.
 
Method Summary
 void afterPropertiesSet()
           
 WebServiceMessage createWebServiceMessage()
          Creates a new, empty WebServiceMessage.
 WebServiceMessage createWebServiceMessage(InputStream inputStream)
          Reads a WebServiceMessage from the given input stream.
protected  String getCharSetEncoding(String contentType)
          Returns the character set from the given content type.
 void setPayloadCaching(boolean payloadCaching)
          Indicates whether the SOAP Body payload should be cached or not.
 void setSoapVersion(SoapVersion version)
          Sets the SOAP Version used by this factory.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AxiomSoapMessageFactory

public AxiomSoapMessageFactory()
Default constructor.

Method Detail

setPayloadCaching

public void setPayloadCaching(boolean payloadCaching)
Indicates whether the SOAP Body payload should be cached or not. Default is true. Setting this to false will increase performance, but also result in the fact that the message payload can only be read once.


setSoapVersion

public void setSoapVersion(SoapVersion version)
Description copied from interface: SoapMessageFactory
Sets the SOAP Version used by this factory.

Specified by:
setSoapVersion in interface SoapMessageFactory
Parameters:
version - the version constant
See Also:
SoapVersion.SOAP_11, SoapVersion.SOAP_12

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

createWebServiceMessage

public WebServiceMessage createWebServiceMessage()
Description copied from interface: WebServiceMessageFactory
Creates a new, empty WebServiceMessage.

Specified by:
createWebServiceMessage in interface WebServiceMessageFactory
Returns:
the empty message

createWebServiceMessage

public WebServiceMessage createWebServiceMessage(InputStream inputStream)
                                          throws IOException
Description copied from interface: WebServiceMessageFactory
Reads a WebServiceMessage from the given input stream.

If the given stream is an instance of TransportInputStream, the headers will be read from the request.

Specified by:
createWebServiceMessage in interface WebServiceMessageFactory
Parameters:
inputStream - the inputstream to read the message from
Returns:
the created message
Throws:
IOException - if an I/O exception occurs

getCharSetEncoding

protected String getCharSetEncoding(String contentType)
Returns the character set from the given content type. Mostly copied

Returns:
the character set encoding

toString

public String toString()
Overrides:
toString in class Object

Spring Web Services Framework

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