org.apache.axis
Class Message

java.lang.Object
  |
  +--org.apache.axis.Message

public class Message
extends java.lang.Object

A complete SOAP (and/or XML-RPC, eventually) message. Includes both the root part (as a SOAPPart), and zero or more MIME attachments (as AttachmentParts).

Eventually should be refactored to generalize SOAPPart for multiple protocols (XML-RPC?).

Author:
Rob Jellinghaus (robj@unrealities.com), Doug Davis (dug@us.ibm.com), Glen Daniels (gdaniels@allaire.com), Rick Rineholt

Field Summary
static java.lang.String DEFAULT_ATTACHMNET_IMPL
          Default Attachments Implementation class
protected static org.apache.commons.logging.Log log
           
static java.lang.String MIME_APPLICATION_DIME
           
static java.lang.String MIME_MULTIPART_RELATED
           
static java.lang.String MIME_UNKNOWN
           
static java.lang.String REQUEST
           
static java.lang.String RESPONSE
           
 
Constructor Summary
Message(java.lang.Object initialContents)
          Construct a Message.
Message(java.lang.Object initialContents, boolean bodyInStream)
          Construct a Message, using the provided initialContents as the contents of the Message's SOAPPart.
Message(java.lang.Object initialContents, boolean bodyInStream, java.lang.String contentType, java.lang.String contentLocation)
          Construct a Message, using the provided initialContents as the contents of the Message's SOAPPart.
 
Method Summary
static java.lang.String getAttachmentImplClassName()
          Returns name of the class prividing Attachment Implementation
 Attachments getAttachments()
          Get the Attachments of this Message.
 int getContentLength()
           
 java.lang.String getContentType()
           
 MessageContext getMessageContext()
           
 java.lang.String getMessageType()
           
 SOAPEnvelope getSOAPEnvelope()
          Get this message's SOAPPart as a SOAPEnvelope
 SOAPPart getSOAPPart()
          Get this message's SOAPPart.
 boolean isAttachmentSupportEnabled()
           
 void setMessageContext(MessageContext msgContext)
           
 void setMessageType(java.lang.String messageType)
           
 void writeContentToStream(java.io.OutputStream os)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log

REQUEST

public static final java.lang.String REQUEST

RESPONSE

public static final java.lang.String RESPONSE

MIME_MULTIPART_RELATED

public static final java.lang.String MIME_MULTIPART_RELATED

MIME_APPLICATION_DIME

public static final java.lang.String MIME_APPLICATION_DIME

DEFAULT_ATTACHMNET_IMPL

public static final java.lang.String DEFAULT_ATTACHMNET_IMPL
Default Attachments Implementation class

MIME_UNKNOWN

public static final java.lang.String MIME_UNKNOWN
Constructor Detail

Message

public Message(java.lang.Object initialContents,
               boolean bodyInStream)
Construct a Message, using the provided initialContents as the contents of the Message's SOAPPart.

Eventually, genericize this to return the RootPart instead, which will have some kind of EnvelopeFactory to enable support for things other than SOAP. But that all will come later, with lots of additional refactoring.

Parameters:
initialContents - may be String, byte[], InputStream, SOAPEnvelope, or AxisFault.
bodyInStream - is true if initialContents is an InputStream containing just the SOAP body (no SOAP-ENV).

Message

public Message(java.lang.Object initialContents,
               boolean bodyInStream,
               java.lang.String contentType,
               java.lang.String contentLocation)
Construct a Message, using the provided initialContents as the contents of the Message's SOAPPart.

Eventually, genericize this to return the RootPart instead, which will have some kind of EnvelopeFactory to enable support for things other than SOAP. But that all will come later, with lots of additional refactoring.

Parameters:
initialContents - may be String, byte[], InputStream, SOAPEnvelope, or AxisFault.
bodyInStream - is true if initialContents is an InputStream containing just the SOAP body (no SOAP-ENV).
contentType - this if the contentType has been already determined. (as in the case of servlets);

Message

public Message(java.lang.Object initialContents)
Construct a Message. An overload of Message(Object, boolean), defaulting bodyInStream to false.
Method Detail

getAttachmentImplClassName

public static java.lang.String getAttachmentImplClassName()
Returns name of the class prividing Attachment Implementation

getMessageType

public java.lang.String getMessageType()

setMessageType

public void setMessageType(java.lang.String messageType)

getMessageContext

public MessageContext getMessageContext()

setMessageContext

public void setMessageContext(MessageContext msgContext)

isAttachmentSupportEnabled

public boolean isAttachmentSupportEnabled()

getSOAPPart

public SOAPPart getSOAPPart()
Get this message's SOAPPart.

Eventually, this should be generalized beyond just SOAP, but it's hard to know how to do that without necessitating a lot of casts in client code. Refactoring keeps getting easier anyhow.


getSOAPEnvelope

public SOAPEnvelope getSOAPEnvelope()
                             throws AxisFault
Get this message's SOAPPart as a SOAPEnvelope

getAttachments

public Attachments getAttachments()
Get the Attachments of this Message. If this returns null, then NO ATTACHMENT SUPPORT EXISTS in this configuration of Axis, and no attachment operations may be performed.

getContentType

public java.lang.String getContentType()
                                throws AxisFault

getContentLength

public int getContentLength()
                     throws AxisFault

writeContentToStream

public void writeContentToStream(java.io.OutputStream os)


Copyright © 2001 Apache XML Project. All Rights Reserved.