Package org.springframework.ws.soap.saaj
Class SaajSoapMessageFactory
java.lang.Object
org.springframework.ws.soap.saaj.SaajSoapMessageFactory
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,SoapMessageFactory
,WebServiceMessageFactory
public class SaajSoapMessageFactory
extends Object
implements SoapMessageFactory, org.springframework.beans.factory.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(jakarta.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, Greg Turnquist
- See Also:
-
Constructor Summary
ConstructorDescriptionDefault, empty constructor.SaajSoapMessageFactory
(jakarta.xml.soap.MessageFactory messageFactory) Constructor that takes a message factory as an argument. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates a new, emptySoapMessage
.createWebServiceMessage
(InputStream inputStream) Reads aSoapMessage
from the given input stream.jakarta.xml.soap.MessageFactory
Returns the SAAJMessageFactory
used.protected void
postProcess
(jakarta.xml.soap.SOAPMessage soapMessage) Template method that allows for post-processing of the givenSOAPMessage
.void
setLangAttributeOnSoap11FaultString
(boolean langAttributeOnSoap11FaultString) Defines whether axml:lang
attribute should be set on SOAP 1.1<faultstring>
elements.void
setMessageFactory
(jakarta.xml.soap.MessageFactory messageFactory) Sets the SAAJMessageFactory
.void
setMessageProperties
(Map<String, ?> messageProperties) Sets the SAAJ message properties.void
setSoapVersion
(SoapVersion version) Sets the SOAP Version used by this factory.toString()
-
Constructor Details
-
SaajSoapMessageFactory
public SaajSoapMessageFactory()Default, empty constructor. -
SaajSoapMessageFactory
public SaajSoapMessageFactory(jakarta.xml.soap.MessageFactory messageFactory) Constructor that takes a message factory as an argument.
-
-
Method Details
-
getMessageFactory
public jakarta.xml.soap.MessageFactory getMessageFactory()Returns the SAAJMessageFactory
used. -
setMessageFactory
public void setMessageFactory(jakarta.xml.soap.MessageFactory messageFactory) Sets the SAAJMessageFactory
. -
setMessageProperties
Sets the SAAJ message properties. These properties will be set on created messages.- See Also:
-
SOAPMessage.setProperty(String, Object)
-
setLangAttributeOnSoap11FaultString
public void setLangAttributeOnSoap11FaultString(boolean langAttributeOnSoap11FaultString) Defines whether axml: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 tofalse
to the older W3C SOAP 1.1 specification.- See Also:
-
setSoapVersion
Description copied from interface:SoapMessageFactory
Sets the SOAP Version used by this factory.- Specified by:
setSoapVersion
in interfaceSoapMessageFactory
- Parameters:
version
- the version constant- See Also:
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
createWebServiceMessage
Description copied from interface:SoapMessageFactory
Creates a new, emptySoapMessage
.- Specified by:
createWebServiceMessage
in interfaceSoapMessageFactory
- Specified by:
createWebServiceMessage
in interfaceWebServiceMessageFactory
- Returns:
- the empty message
-
createWebServiceMessage
Description copied from interface:SoapMessageFactory
Reads aSoapMessage
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 interfaceSoapMessageFactory
- Specified by:
createWebServiceMessage
in interfaceWebServiceMessageFactory
- Parameters:
inputStream
- the input stream to read the message from- Returns:
- the created message
- Throws:
IOException
- if an I/O exception occurs
-
postProcess
protected void postProcess(jakarta.xml.soap.SOAPMessage soapMessage) throws jakarta.xml.soap.SOAPException Template method that allows for post-processing of the givenSOAPMessage
.Default implementation sets message properties, if any.
- Parameters:
soapMessage
- the message to post process- Throws:
jakarta.xml.soap.SOAPException
- See Also:
-
toString
-