public class MessageFactoryImpl extends MessageFactory
A factory for creating
A JAXM client performs the following steps to create a message.
MessageFactoryobject from a
conin the following line of code). The
Stringpassed to the
createMessageFactorymethod is the name of of a messaging profile, which must be the URL for the schema.
MessageFactory mf = con.createMessageFactory(schemaURL);
MessageFactoryobject. All messages produced by this
MessageFactoryobject will have the header information appropriate for the messaging profile that was specified when the
MessageFactoryobject was created.
SOAPMessage m = mf.createMessage();
MessageFactoryobject using the method
newInstance, as shown in the following line of code.
MessageFactory mf = MessageFactory.newInstance();A standalone client (a client that is not running in a container) can use the
newInstancemethod to create a
MessageFactory objects, regardless of how they are created, will produce
SOAPMessage objects that have the following elements by default:
MessageFactoryobject was created using a
ProviderConnectionobject, which means that it was initialized with a specified profile, it will produce messages that also come prepopulated with additional entries in the
SOAPHeaderobject and the
SOAPBodyobject. The content of a new
SOAPMessageobject depends on which of the two
MessageFactorymethods is used to create it.
createMessage()-- message has no content
createMessage(MimeHeaders, java.io.InputStream)-- message has content from the
InputStreamobject and headers from the
|Constructor and Description|
|Modifier and Type||Method and Description|
Creates a new
Internalizes the contents of the given
Specify whether MTOM messages should be processed or parsed literally.
protected String soapVersion
public SOAPMessage createMessage() throws SOAPException
SOAPMessageobject with the default
SOAPHeaderobjects. Profile-specific message factories can choose to prepopulate the
SOAPMessageobject with profile-specific headers.
Content can be added to this message's
SOAPPart object, and the message can
be sent "as is" when a message containing only a SOAP part is sufficient. Otherwise, the
SOAPMessage object needs to create one or more
objects and add them to itself. Any content that is not in XML format must be in an
public SOAPMessage createMessage(MimeHeaders mimeheaders, InputStream inputstream) throws IOException, SOAPException
InputStreamobject into a new
SOAPMessageobject and returns the
mimeheaders- the transport-specific headers passed to the message in a transport-independent fashion for creation of the message
InputStreamobject that contains the data for a message
SOAPMessageobject containing the data from the given
IOException- if there is a problem in reading data from the input stream
SOAPException- if the message is invalid
public void setSOAPVersion(String soapVersion)
public void setProcessMTOM(boolean processMTOM)
The way MTOM messages are handled fundamentally differs between Axiom and SAAJ.
While Axiom replaces xop:Include elements by
OMText nodes, there is no such requirement in SAAJ. The only
requirement there is that
returns the relevant
AttachmentPart when applied to an
This method allows to make this SAAJ implementation behave as Axiom, i.e. to substitute xop:Include elements.
processMTOM- whether xop:Include elements should be substituted
Copyright © 2004-2015 The Apache Software Foundation. All Rights Reserved.