SOAPMessage objects.
A SAAJ client can create a MessageFactory object
using the method newInstance, as shown in the following
lines of code.
MessageFactory mf = MessageFactory.newInstance();
MessageFactory mf12 = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
All MessageFactory objects, regardless of how they are
created, will produce SOAPMessage objects that
have the following elements by default:
SOAPPart object
SOAPEnvelope object
SOAPBody object
SOAPHeader object
SOAPHeader object and the
SOAPBody object.
The content of a new SOAPMessage object depends on which of the two
MessageFactory methods is used to create it.
createMessage() createMessage(MimeHeaders, java.io.InputStream) -- message has
content from the InputStream object and headers from the
MimeHeaders object | Modifier and Type | Field and Description |
|---|---|
| private static final String |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract SOAPMessage | Returns: a newSOAPMessage objectCreates a new |
| public abstract SOAPMessage | Returns: a newSOAPMessage object containing the data from
the given InputStream objectthe transport-specific headers passed to the
message in a transport-independent fashion for creation of the
message headers, InputStream the in)InputStream object that contains the data
for a messageInternalizes the contents of the given |
| public static MessageFactory | Returns: a new instance of aMessageFactoryCreates a new |
| public static MessageFactory | Returns: a new instance of aMessageFactorya string constant representing the class of the
specified message factory implementation. May be
either protocol)DYNAMIC_SOAP_PROTOCOL,
DEFAULT_SOAP_PROTOCOL (which is the same
as) SOAP_1_1_PROTOCOL, or
SOAP_1_2_PROTOCOL.Creates a new |
| DEFAULT_MESSAGE_FACTORY | back to summary |
|---|---|
| private static final String DEFAULT_MESSAGE_FACTORY | |
| MessageFactory | back to summary |
|---|---|
| protected MessageFactory() Default constructor. | |
| createMessage | back to summary |
|---|---|
| public abstract SOAPMessage createMessage() throws SOAPException Creates a new
Content can be added to this message's
| |
| createMessage | back to summary |
|---|---|
| public abstract SOAPMessage createMessage(MimeHeaders headers, InputStream in) throws IOException, SOAPException Internalizes the contents of the given
| |
| newInstance | back to summary |
|---|---|
| public static MessageFactory newInstance() throws SOAPException Creates a new
| |
| newInstance | back to summary |
|---|---|
| public static MessageFactory newInstance(String protocol) throws SOAPException Creates a new
| |