Creating a Message

The first step is to create a message using a MessageFactory object.
The SAAJ API provides a default implementation of the MessageFactory class,
thus making it easy to get an instance. The following code fragment illustrates
getting an instance of the default message factory and then using it to create
a message.

As is true of the newInstance method for SOAPConnectionFactory, the newInstance method for MessageFactory is static, so you invoke it by calling MessageFactory.newInstance.

If you specify no arguments to the newInstance method,
it creates a message factory for SOAP 1.1 messages. To create a message factory
that allows you to create and process SOAP 1.2 messages, use the following
method call: