FileDocCategorySizeDatePackage
MessageFactoryImpl.javaAPI DocApache Axis 1.43353Sat Apr 22 18:57:26 BST 2006org.apache.axis.soap

MessageFactoryImpl

public class MessageFactoryImpl extends MessageFactory
Message Factory implementation
author
Davanum Srinivas (dims@yahoo.com)

Fields Summary
Constructors Summary
Methods Summary
public javax.xml.soap.SOAPMessagecreateMessage()
Creates a new SOAPMessage object with the default SOAPPart, SOAPEnvelope, SOAPBody, and SOAPHeader objects. Profile-specific message factories can choose to prepopulate the SOAPMessage object with profile-specific headers.

Content can be added to this message's SOAPPart object, and the message can be sent "as is" when a message containing only a SOAP part is sufficient. Otherwise, the SOAPMessage object needs to create one or more AttachmentPart objects and add them to itself. Any content that is not in XML format must be in an AttachmentPart object.

return
a new SOAPMessage object
throws
SOAPException if a SOAP error occurs

        SOAPEnvelope env = new SOAPEnvelope();
        env.setSAAJEncodingCompliance(true);
        Message message = new Message(env);
        message.setMessageType(Message.REQUEST);
        return message;
    
public javax.xml.soap.SOAPMessagecreateMessage(javax.xml.soap.MimeHeaders mimeheaders, java.io.InputStream inputstream)
Internalizes the contents of the given InputStream object into a new SOAPMessage object and returns the SOAPMessage object.

param
mimeheaders the transport-specific headers passed to the message in a transport-independent fashion for creation of the message
param
inputstream the InputStream object that contains the data for a message
return
a new SOAPMessage object containing the data from the given InputStream object
throws
IOException if there is a problem in reading data from the input stream
throws
SOAPException if the message is invalid

        Message message = new Message(inputstream, false, mimeheaders);
        message.setMessageType(Message.REQUEST);
        return message;