Package com.sun.xml.messaging.saaj.soap
Class MessageFactoryImpl
- java.lang.Object
-
- jakarta.xml.soap.MessageFactory
-
- com.sun.xml.messaging.saaj.soap.MessageFactoryImpl
-
- Direct Known Subclasses:
SOAPMessageFactory1_1Impl,SOAPMessageFactory1_2Impl,SOAPMessageFactoryDynamicImpl
public class MessageFactoryImpl extends MessageFactory
A factory for creating SOAP messages. Converted to a placeholder for common functionality between SOAP implementations.- Author:
- Phil Goodwin (phil.goodwin@sun.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanlazyAttachmentsprotected OutputStreamlistener
-
Constructor Summary
Constructors Constructor Description MessageFactoryImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SOAPMessagecreateMessage()Creates a newSOAPMessageobject with the defaultSOAPPart,SOAPEnvelope,SOAPBody, andSOAPHeaderobjects.SOAPMessagecreateMessage(boolean isFastInfoset, boolean acceptFastInfoset)SOAPMessagecreateMessage(MimeHeaders headers, InputStream in)Internalizes the contents of the givenInputStreamobject into a newSOAPMessageobject and returns theSOAPMessageobject.SOAPMessagecreateMessage(MimeHeaders headers, XMLStreamReader reader)SOAPMessagecreateMessage(String protocol)protected static StringgetContentType(MimeHeaders headers)OutputStreamlisten(OutputStream newListener)voidsetLazyAttachmentOptimization(boolean flag)-
Methods inherited from class jakarta.xml.soap.MessageFactory
newInstance, newInstance
-
-
-
-
Field Detail
-
listener
protected OutputStream listener
-
lazyAttachments
protected boolean lazyAttachments
-
-
Method Detail
-
listen
public OutputStream listen(OutputStream newListener)
-
createMessage
public SOAPMessage createMessage() throws SOAPException
Description copied from class:MessageFactoryCreates a newSOAPMessageobject with the defaultSOAPPart,SOAPEnvelope,SOAPBody, andSOAPHeaderobjects. Profile-specific message factories can choose to prepopulate theSOAPMessageobject with profile-specific headers.Content can be added to this message's
SOAPPartobject, and the message can be sent "as is" when a message containing only a SOAP part is sufficient. Otherwise, theSOAPMessageobject needs to create one or moreAttachmentPartobjects and add them to itself. Any content that is not in XML format must be in anAttachmentPartobject.- Specified by:
createMessagein classMessageFactory- Returns:
- a new
SOAPMessageobject - Throws:
SOAPException- if a SOAP error occurs
-
createMessage
public SOAPMessage createMessage(String protocol) throws SOAPException
- Throws:
SOAPException
-
createMessage
public SOAPMessage createMessage(boolean isFastInfoset, boolean acceptFastInfoset) throws SOAPException
- Throws:
SOAPException
-
createMessage
public SOAPMessage createMessage(MimeHeaders headers, XMLStreamReader reader) throws SOAPException, IOException
- Throws:
SOAPExceptionIOException
-
createMessage
public SOAPMessage createMessage(MimeHeaders headers, InputStream in) throws SOAPException, IOException
Description copied from class:MessageFactoryInternalizes the contents of the givenInputStreamobject into a newSOAPMessageobject and returns theSOAPMessageobject.- Specified by:
createMessagein classMessageFactory- Parameters:
headers- the transport-specific headers passed to the message in a transport-independent fashion for creation of the messagein- theInputStreamobject that contains the data for a message- Returns:
- a new
SOAPMessageobject containing the data from the givenInputStreamobject - Throws:
SOAPException- may be thrown if the message is invalidIOException- if there is a problem in reading data from the input stream
-
getContentType
protected static final String getContentType(MimeHeaders headers)
-
setLazyAttachmentOptimization
public void setLazyAttachmentOptimization(boolean flag)
-
-