Spring Web Services Framework

org.springframework.ws.soap.saaj
Class SaajSoapMessageFactory

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

public class SaajSoapMessageFactory
extends Object
implements SoapMessageFactory, InitializingBean

SAAJ-specific implementation of the WebServiceMessageFactory. Wraps a SAAJ MessageFactory. This factory will use SAAJ 1.3 when found, or fall back to SAAJ 1.2 or even 1.1.

A SAAJ MessageFactory can be injected to the constructor, or by the setMessageFactory(javax.xml.soap.MessageFactory) property. When a SAAJ message factory is injected, the setSoapVersion(org.springframework.ws.soap.SoapVersion) property is ignored.

Since:
1.0.0
Author:
Arjen Poutsma
See Also:
SaajSoapMessage

Constructor Summary
SaajSoapMessageFactory()
          Default, empty constructor.
SaajSoapMessageFactory(MessageFactory messageFactory)
          Constructor that takes a message factory as an argument.
 
Method Summary
 void afterPropertiesSet()
           
 WebServiceMessage createWebServiceMessage()
          Creates a new, empty WebServiceMessage.
 WebServiceMessage createWebServiceMessage(InputStream inputStream)
          Reads a WebServiceMessage from the given input stream.
 MessageFactory getMessageFactory()
          Returns the SAAJ MessageFactory used.
 void setlangAttributeOnSoap11FaultString(boolean langAttributeOnSoap11FaultString)
          Defines whether a xml:lang attribute should be set on SOAP 1.1 <faultstring> elements.
 void setMessageFactory(MessageFactory messageFactory)
          Sets the SAAJ MessageFactory.
 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

SaajSoapMessageFactory

public SaajSoapMessageFactory()
Default, empty constructor.


SaajSoapMessageFactory

public SaajSoapMessageFactory(MessageFactory messageFactory)
Constructor that takes a message factory as an argument.

Method Detail

getMessageFactory

public MessageFactory getMessageFactory()
Returns the SAAJ MessageFactory used.


setMessageFactory

public void setMessageFactory(MessageFactory messageFactory)
Sets the SAAJ MessageFactory.


setlangAttributeOnSoap11FaultString

public void setlangAttributeOnSoap11FaultString(boolean langAttributeOnSoap11FaultString)
Defines whether a xml:lang attribute should be set on SOAP 1.1 <faultstring> elements.

The default is true, to comply with WS-I, but this flag can be set to false to the older W3C SOAP 1.1 specification.

See Also:
WS-I Basic Profile 1.1

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

toString

public String toString()
Overrides:
toString in class Object

Spring Web Services Framework

Copyright © 2005-2010 The Spring Web Services Framework. All Rights Reserved.