public static MessageFactory newInstance (String protocol) throws SOAPException

Creates a new MessageFactory object that is an instance of the specified implementation. May be a dynamic message factory, a SOAP 1.1 message factory, or a SOAP 1.2 message factory. A dynamic message factory creates messages based on the MIME headers specified as arguments to the createMessage method. This method uses the SAAJMetaFactory to locate the implementation class and create the MessageFactory instance.

Parameters:
protocol    a string constant representing the class of the specified message factory implementation. May be either DYNAMIC_SOAP_PROTOCOL, DEFAULT_SOAP_PROTOCOL (which is the same as) SOAP_1_1_PROTOCOL, or SOAP_1_2_PROTOCOL.

Returns:  a new instance of a MessageFactory

Exceptions:
SOAPException    if there was an error in creating the specified implementation of MessageFactory.

See also:
SAAJMetaFactory

Since:  SAAJ 1.3