Package com.sun.xml.ws.api.message.saaj
Class SAAJFactory
- java.lang.Object
-
- com.sun.xml.ws.api.message.saaj.SAAJFactory
-
public class SAAJFactory extends Object
Factory SPI for SAAJ implementations- Since:
- 2.2.6
-
-
Constructor Summary
Constructors Constructor Description SAAJFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static voidaddAttachmentsToSOAPMessage(javax.xml.soap.SOAPMessage msg, Message message)static Messagecreate(javax.xml.soap.SOAPMessage saaj)Creates Message from SOAPMessageMessagecreateMessage(javax.xml.soap.SOAPMessage saaj)Creates Message from SOAPMessagejavax.xml.soap.MessageFactorycreateMessageFactory(String protocol)Creates a newMessageFactoryobject that is an instance of the specified implementation.javax.xml.soap.SOAPFactorycreateSOAPFactory(String protocol)Creates a newSOAPFactoryobject that is an instance of the specified implementation, this method uses the SAAJMetaFactory to locate the implementation class and create the SOAPFactory instance.static javax.xml.soap.MessageFactorygetMessageFactory(String protocol)Creates a newMessageFactoryobject that is an instance of the specified implementation.static javax.xml.soap.SOAPFactorygetSOAPFactory(String protocol)Creates a newSOAPFactoryobject that is an instance of the specified implementation, this method uses the SAAJMetaFactory to locate the implementation class and create the SOAPFactory instance.static SAAJMessageread(Packet packet)Reads the message within the Packet to a SAAJMessage.static javax.xml.soap.SOAPMessageread(SOAPVersion soapVersion, Message message)Reads Message as SOAPMessage.static javax.xml.soap.SOAPMessageread(SOAPVersion soapVersion, Message message, Packet packet)Reads Message as SOAPMessage.SAAJMessagereadAsSAAJ(Packet packet)Reads the message within the Packet to a SAAJMessage.javax.xml.soap.SOAPMessagereadAsSOAPMessage(SOAPVersion soapVersion, Message message)Reads Message as SOAPMessage.javax.xml.soap.SOAPMessagereadAsSOAPMessage(SOAPVersion soapVersion, Message message, Packet packet)Reads Message as SOAPMessage.javax.xml.soap.SOAPMessagereadAsSOAPMessageSax2Dom(SOAPVersion soapVersion, Message message)
-
-
-
Method Detail
-
getMessageFactory
public static javax.xml.soap.MessageFactory getMessageFactory(String protocol) throws javax.xml.soap.SOAPException
Creates a newMessageFactoryobject 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 thecreateMessagemethod. 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 eitherDYNAMIC_SOAP_PROTOCOL,DEFAULT_SOAP_PROTOCOL(which is the same as)SOAP_1_1_PROTOCOL, orSOAP_1_2_PROTOCOL.- Returns:
- a new instance of a
MessageFactory - Throws:
javax.xml.soap.SOAPException- if there was an error in creating the specified implementation ofMessageFactory.- See Also:
SAAJMetaFactory
-
getSOAPFactory
public static javax.xml.soap.SOAPFactory getSOAPFactory(String protocol) throws javax.xml.soap.SOAPException
Creates a newSOAPFactoryobject that is an instance of the specified implementation, this method uses the SAAJMetaFactory to locate the implementation class and create the SOAPFactory instance.- Parameters:
protocol- a string constant representing the protocol of the specified SOAP factory implementation. May be eitherDYNAMIC_SOAP_PROTOCOL,DEFAULT_SOAP_PROTOCOL(which is the same as)SOAP_1_1_PROTOCOL, orSOAP_1_2_PROTOCOL.- Returns:
- a new instance of a
SOAPFactory - Throws:
javax.xml.soap.SOAPException- if there was an error creating the specifiedSOAPFactory- See Also:
SAAJMetaFactory
-
create
public static Message create(javax.xml.soap.SOAPMessage saaj)
Creates Message from SOAPMessage- Parameters:
saaj- SOAPMessage- Returns:
- created Message
-
read
public static javax.xml.soap.SOAPMessage read(SOAPVersion soapVersion, Message message) throws javax.xml.soap.SOAPException
Reads Message as SOAPMessage. After this call message is consumed.- Parameters:
soapVersion- SOAP versionmessage- Message- Returns:
- Created SOAPMessage
- Throws:
javax.xml.soap.SOAPException- if SAAJ processing fails
-
read
public static javax.xml.soap.SOAPMessage read(SOAPVersion soapVersion, Message message, Packet packet) throws javax.xml.soap.SOAPException
Reads Message as SOAPMessage. After this call message is consumed.- Parameters:
soapVersion- SOAP versionmessage- Messagepacket- The packet that owns the Message- Returns:
- Created SOAPMessage
- Throws:
javax.xml.soap.SOAPException- if SAAJ processing fails
-
read
public static SAAJMessage read(Packet packet) throws javax.xml.soap.SOAPException
Reads the message within the Packet to a SAAJMessage. After this call message is consumed.- Parameters:
packet- Packet- Returns:
- Created SAAJPMessage
- Throws:
javax.xml.soap.SOAPException- if SAAJ processing fails
-
readAsSAAJ
public SAAJMessage readAsSAAJ(Packet packet) throws javax.xml.soap.SOAPException
Reads the message within the Packet to a SAAJMessage. After this call message is consumed.- Parameters:
packet- Packet- Returns:
- Created SAAJPMessage
- Throws:
javax.xml.soap.SOAPException- if SAAJ processing fails
-
createMessageFactory
public javax.xml.soap.MessageFactory createMessageFactory(String protocol) throws javax.xml.soap.SOAPException
Creates a newMessageFactoryobject 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 thecreateMessagemethod. 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 eitherDYNAMIC_SOAP_PROTOCOL,DEFAULT_SOAP_PROTOCOL(which is the same as)SOAP_1_1_PROTOCOL, orSOAP_1_2_PROTOCOL.- Returns:
- a new instance of a
MessageFactory - Throws:
javax.xml.soap.SOAPException- if there was an error in creating the specified implementation ofMessageFactory.- See Also:
SAAJMetaFactory
-
createSOAPFactory
public javax.xml.soap.SOAPFactory createSOAPFactory(String protocol) throws javax.xml.soap.SOAPException
Creates a newSOAPFactoryobject that is an instance of the specified implementation, this method uses the SAAJMetaFactory to locate the implementation class and create the SOAPFactory instance.- Parameters:
protocol- a string constant representing the protocol of the specified SOAP factory implementation. May be eitherDYNAMIC_SOAP_PROTOCOL,DEFAULT_SOAP_PROTOCOL(which is the same as)SOAP_1_1_PROTOCOL, orSOAP_1_2_PROTOCOL.- Returns:
- a new instance of a
SOAPFactory - Throws:
javax.xml.soap.SOAPException- if there was an error creating the specifiedSOAPFactory- See Also:
SAAJMetaFactory
-
createMessage
public Message createMessage(javax.xml.soap.SOAPMessage saaj)
Creates Message from SOAPMessage- Parameters:
saaj- SOAPMessage- Returns:
- created Message
-
readAsSOAPMessage
public javax.xml.soap.SOAPMessage readAsSOAPMessage(SOAPVersion soapVersion, Message message) throws javax.xml.soap.SOAPException
Reads Message as SOAPMessage. After this call message is consumed.- Parameters:
soapVersion- SOAP versionmessage- Message- Returns:
- Created SOAPMessage
- Throws:
javax.xml.soap.SOAPException- if SAAJ processing fails
-
readAsSOAPMessageSax2Dom
public javax.xml.soap.SOAPMessage readAsSOAPMessageSax2Dom(SOAPVersion soapVersion, Message message) throws javax.xml.soap.SOAPException
- Throws:
javax.xml.soap.SOAPException
-
addAttachmentsToSOAPMessage
protected static void addAttachmentsToSOAPMessage(javax.xml.soap.SOAPMessage msg, Message message)
-
readAsSOAPMessage
public javax.xml.soap.SOAPMessage readAsSOAPMessage(SOAPVersion soapVersion, Message message, Packet packet) throws javax.xml.soap.SOAPException
Reads Message as SOAPMessage. After this call message is consumed. The implementation in this class simply calls readAsSOAPMessage(SOAPVersion, Message), and ignores the other parameters Subclasses can override and choose to base SOAPMessage creation on Packet properties if needed- Parameters:
soapVersion- SOAP versionmessage- Message- Returns:
- Created SOAPMessage
- Throws:
javax.xml.soap.SOAPException- if SAAJ processing fails
-
-