org.apache.axis2.jaxws.message
Interface Message

All Superinterfaces:
XMLPart
All Known Implementing Classes:
MessageImpl

public interface Message
extends XMLPart

Message

A Message represents the XML + Attachments

Most of the methods available on a message are only applicable to the XML part of the Message. See the XMLPart interface for an explantation of these methods.

See Also:
XMLPart, Attachment

Method Summary
 void addDataHandler(javax.activation.DataHandler dh, java.lang.String id)
          Add Attachment
 SOAPMessage getAsSOAPMessage()
          getAsSOAPMessage Get the xml part as a read/write SOAPEnvelope
 java.lang.String getAttachmentID(int index)
          Get the indicated (non-soap part) attachment id
 java.lang.String getAttachmentID(java.lang.String partName)
          Get the indicated (non-soap part) attachment id
 java.util.List<java.lang.String> getAttachmentIDs()
          Get the list of attachment content ids for the message
 javax.activation.DataHandler getDataHandler(java.lang.String cid)
          Get the attachment identified by the contentID
 MessageContext getMessageContext()
           
 java.util.Map getMimeHeaders()
           
 Protocol getProtocol()
          Get the protocol for this Message (soap11, soap12, etc.)
 java.lang.Object getValue(java.lang.Object context, BlockFactory blockFactory)
           
 boolean isDoingSWA()
           
 boolean isMTOMEnabled()
          A message is MTOM enabled if the associated dispatch/client/impl/provider has a binding type that enables MTOM.
 boolean isPostPivot()
           
 javax.activation.DataHandler removeDataHandler(java.lang.String cid)
          Get the attachment and remove it from the Message
 void setDoingSWA(boolean value)
          Indicate that an SWA DataHandler was added to the message.
 void setMessageContext(MessageContext messageContext)
          JAX-WS Message Context that owns the Message
 void setMimeHeaders(java.util.Map map)
          Set the transport headers
 void setMTOMEnabled(boolean b)
          A message is MTOM enabled if the associated dispatch/client/impl/provider has a binding type that enables MTOM.
 void setPostPivot()
          Indicate that this message is passed the pivot point.
 
Methods inherited from interface org.apache.axis2.jaxws.message.XMLPart
appendHeaderBlock, close, getAsOMElement, getAsSOAPEnvelope, getBodyBlock, getBodyBlock, getHeaderBlock, getHeaderBlocks, getHeaderQNames, getIndirection, getNumBodyBlocks, getNumHeaderBlocks, getOperationElement, getParent, getStyle, getXMLFault, getXMLPartContentType, getXMLStreamReader, isConsumed, isFault, outputTo, removeBodyBlock, removeHeaderBlock, setBodyBlock, setBodyBlock, setHeaderBlock, setIndirection, setOperationElement, setParent, setStyle, setXMLFault, traceString
 

Method Detail

getProtocol

Protocol getProtocol()
Get the protocol for this Message (soap11, soap12, etc.)

Specified by:
getProtocol in interface XMLPart
Returns:
Protocl

getAsSOAPMessage

SOAPMessage getAsSOAPMessage()
                             throws WebServiceException
getAsSOAPMessage Get the xml part as a read/write SOAPEnvelope

Returns:
SOAPEnvelope
Throws:
WebServiceException

addDataHandler

void addDataHandler(javax.activation.DataHandler dh,
                    java.lang.String id)
Add Attachment

Parameters:
dh - DataHandler (type of Attachment is inferred from dh.getContentType)
id - String which is the Attachment content id
See Also:
addAttachment(Attachment)

getAttachmentIDs

java.util.List<java.lang.String> getAttachmentIDs()
Get the list of attachment content ids for the message

Returns:
List

getAttachmentID

java.lang.String getAttachmentID(int index)
Get the indicated (non-soap part) attachment id

Parameters:
index -
Returns:
CID or null if not present

getAttachmentID

java.lang.String getAttachmentID(java.lang.String partName)
Get the indicated (non-soap part) attachment id

Parameters:
partName - (WS-I indicates that SWA attachments have a partName prefix)
Returns:
CID or null if not present

getDataHandler

javax.activation.DataHandler getDataHandler(java.lang.String cid)
Get the attachment identified by the contentID

Parameters:
cid -
Returns:

setDoingSWA

void setDoingSWA(boolean value)
Indicate that an SWA DataHandler was added to the message. This information will be used to trigger SWA serialization.

Parameters:
value -

isDoingSWA

boolean isDoingSWA()
Returns:
true if SWA DataHandler is present

removeDataHandler

javax.activation.DataHandler removeDataHandler(java.lang.String cid)
Get the attachment and remove it from the Message

Parameters:
cid -

isMTOMEnabled

boolean isMTOMEnabled()
A message is MTOM enabled if the associated dispatch/client/impl/provider has a binding type that enables MTOM.

Returns:
if this is an MTOM message

setMTOMEnabled

void setMTOMEnabled(boolean b)
A message is MTOM enabled if the associated dispatch/client/impl/provider has a binding type that enables MTOM. Indicate whether this is an MTOM message

Parameters:
b -

getMimeHeaders

java.util.Map getMimeHeaders()
Returns:
get the transport headers map.

setMimeHeaders

void setMimeHeaders(java.util.Map map)
Set the transport headers

Parameters:
map - Map

setPostPivot

void setPostPivot()
Indicate that this message is passed the pivot point. For example, this is set in the JAX-WS Dispatcher to indicate


isPostPivot

boolean isPostPivot()
Returns:
true if post pivot

setMessageContext

void setMessageContext(MessageContext messageContext)
JAX-WS Message Context that owns the Message

Parameters:
messageContext -

getMessageContext

MessageContext getMessageContext()
Returns:
JAX-WS MessageContext

getValue

java.lang.Object getValue(java.lang.Object context,
                          BlockFactory blockFactory)
                          throws WebServiceException
Throws:
WebServiceException


Copyright © 2007 Apache Web Services Project. All Rights Reserved.