|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.axis2.jaxws.message.impl.MessageImpl
public class MessageImpl
MessageImpl A Message is an XML part + Attachments. Most of the implementation delegates to the XMLPart implementation. NOTE: For XML/HTTP (REST), a SOAP 1.1. Envelope is built and the rest payload is placed in the body. This purposely mimics the Axis2 implementation.
| Method Summary | |
|---|---|
void |
addDataHandler(javax.activation.DataHandler dh,
java.lang.String id)
Add Attachment |
void |
appendHeaderBlock(java.lang.String namespace,
java.lang.String localPart,
Block block)
appendHeaderBlock Append the block to the list of header blocks. |
void |
close()
Used primarily to ensure the parser is forwarded to the end so it can be closed. |
org.apache.axiom.om.OMElement |
getAsOMElement()
getAsOMElement Get the xml part as a read/write OM...note this returns an OM SOAPEnvelope for all protocols...even REST |
javax.xml.soap.SOAPEnvelope |
getAsSOAPEnvelope()
getAsEnvelope Get the xml part as a read/write SOAPEnvelope |
javax.xml.soap.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 |
Block |
getBodyBlock(int index,
java.lang.Object context,
BlockFactory blockFactory)
getBodyBlock Get the body block at the specificed index. |
Block |
getBodyBlock(java.lang.Object context,
BlockFactory blockFactory)
getBodyBlock Get the single Body Block. |
java.util.List<javax.xml.namespace.QName> |
getBodyBlockQNames()
getBodyBlockQNames Calling this method will cache the OM. |
javax.activation.DataHandler |
getDataHandler(java.lang.String cid)
Get the attachment identified by the contentID |
Block |
getHeaderBlock(java.lang.String namespace,
java.lang.String localPart,
java.lang.Object context,
BlockFactory blockFactory)
getHeaderBlock Get the firstheader block with the specified name. |
java.util.List<Block> |
getHeaderBlocks(java.lang.String namespace,
java.lang.String localPart,
java.lang.Object context,
BlockFactory blockFactory,
org.apache.axiom.soap.RolePlayer rolePlayer)
getHeaderBlock Get the header blocks with the specified name The BlockFactory and object context are passed in to help create the proper kind of block. |
java.util.Set<javax.xml.namespace.QName> |
getHeaderQNames()
|
int |
getIndirection()
Get indirection. |
MessageContext |
getMessageContext()
|
java.util.Map |
getMimeHeaders()
|
int |
getNumBodyBlocks()
getNumBodyBlocks Calling this method will cache the OM. |
int |
getNumHeaderBlocks()
getNumHeaderBlocks |
javax.xml.namespace.QName |
getOperationElement()
|
Message |
getParent()
getParent Get the Message object that this XMLPart is attached to, if it is attached to one at all. |
Protocol |
getProtocol()
Get the protocol for this Message (soap11, soap12, etc.) |
javax.jws.soap.SOAPBinding.Style |
getStyle()
|
java.lang.Object |
getValue(java.lang.Object context,
BlockFactory blockFactory)
|
XMLFault |
getXMLFault()
If the XMLPart represents a fault, an XMLFault is returned which describes the fault in a protocol agnostic manner |
java.lang.String |
getXMLPartContentType()
The representation of the XMLPart may be in a number of different forms. |
javax.xml.stream.XMLStreamReader |
getXMLStreamReader(boolean consume)
Get the XMLStreamReader represented by this Message for the xml part |
boolean |
isConsumed()
isConsumed Return true if the part is consumed. |
boolean |
isDoingSWA()
|
boolean |
isFault()
Determines whether the XMLPart represents a Fault |
boolean |
isMTOMEnabled()
A message is MTOM enabled if the associated dispatch/client/impl/provider has a binding type that enables MTOM. |
boolean |
isPostPivot()
|
void |
outputTo(javax.xml.stream.XMLStreamWriter writer,
boolean consume)
Write out the Message |
void |
removeBodyBlock(int index)
removeBodyBlock Removes the indicated BodyBlock |
javax.activation.DataHandler |
removeDataHandler(java.lang.String cid)
Get the attachment and remove it from the Message |
void |
removeHeaderBlock(java.lang.String namespace,
java.lang.String localPart)
removeHeaderBlock Removes all header blocks with this namespace/localpart |
void |
setBodyBlock(Block block)
setBodyBlock Set this as block as the single block for the message. |
void |
setBodyBlock(int index,
Block block)
setBodyBlock Set the block at the specified index Once set, the Message owns the block. |
void |
setDoingSWA(boolean value)
Indicate that an SWA DataHandler was added to the message. |
void |
setHeaderBlock(java.lang.String namespace,
java.lang.String localPart,
Block block)
setHeaderBlock replaces the first existing header block with this new block. |
void |
setIndirection(int indirection)
Set indirection. |
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 |
setOperationElement(javax.xml.namespace.QName operationQName)
Set the operation element qname. |
void |
setParent(Message msg)
setParent Set the Message object that will hold this XMLPart |
void |
setPostPivot()
Indicate that this message is passed the pivot point. |
void |
setStyle(javax.jws.soap.SOAPBinding.Style style)
Set the Style. |
void |
setXMLFault(XMLFault xmlFault)
Change the XMLPart so that it represents the fault described by XMLFault |
java.lang.String |
traceString(java.lang.String indent)
Get a traceString...the trace string dumps the contents of the Block without forcing an underlying ill-performant transformation of the message. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public javax.xml.soap.SOAPMessage getAsSOAPMessage()
throws javax.xml.ws.WebServiceException
Message
getAsSOAPMessage in interface Messagejavax.xml.ws.WebServiceExceptionpublic java.lang.String getAttachmentID(int index)
getAttachmentID in interface Messageindex -
public java.lang.String getAttachmentID(java.lang.String partName)
Message
getAttachmentID in interface MessagepartName - (WS-I indicates that SWA attachments have a partName prefix)
public java.lang.Object getValue(java.lang.Object context,
BlockFactory blockFactory)
throws javax.xml.ws.WebServiceException
getValue in interface Messagejavax.xml.ws.WebServiceExceptionpublic java.util.List<java.lang.String> getAttachmentIDs()
Message
getAttachmentIDs in interface Messagepublic javax.activation.DataHandler getDataHandler(java.lang.String cid)
Message
getDataHandler in interface Messagepublic javax.activation.DataHandler removeDataHandler(java.lang.String cid)
Message
removeDataHandler in interface Messagepublic Protocol getProtocol()
Message
getProtocol in interface MessagegetProtocol in interface XMLPart
public org.apache.axiom.om.OMElement getAsOMElement()
throws javax.xml.ws.WebServiceException
XMLPart
getAsOMElement in interface XMLPartjavax.xml.ws.WebServiceException
public javax.xml.soap.SOAPEnvelope getAsSOAPEnvelope()
throws javax.xml.ws.WebServiceException
XMLPart
getAsSOAPEnvelope in interface XMLPartjavax.xml.ws.WebServiceException
public Block getBodyBlock(int index,
java.lang.Object context,
BlockFactory blockFactory)
throws javax.xml.ws.WebServiceException
XMLPart
getBodyBlock in interface XMLPartjavax.xml.ws.WebServiceExceptiongetBodyBlock
public Block getHeaderBlock(java.lang.String namespace,
java.lang.String localPart,
java.lang.Object context,
BlockFactory blockFactory)
throws javax.xml.ws.WebServiceException
XMLPart
getHeaderBlock in interface XMLPartjavax.xml.ws.WebServiceException
public java.util.List<Block> getHeaderBlocks(java.lang.String namespace,
java.lang.String localPart,
java.lang.Object context,
BlockFactory blockFactory,
org.apache.axiom.soap.RolePlayer rolePlayer)
throws javax.xml.ws.WebServiceException
XMLPart
getHeaderBlocks in interface XMLPartnamespace - uri of headerlocalPart - local name of headercontext - context for blockFactoryblockFactory - kind of factory (i.e. JAXB)
javax.xml.ws.WebServiceException
public int getNumBodyBlocks()
throws javax.xml.ws.WebServiceException
XMLPart
getNumBodyBlocks in interface XMLPartjavax.xml.ws.WebServiceException
public java.util.List<javax.xml.namespace.QName> getBodyBlockQNames()
throws javax.xml.ws.WebServiceException
XMLPart
getBodyBlockQNames in interface XMLPartjavax.xml.ws.WebServiceException
public int getNumHeaderBlocks()
throws javax.xml.ws.WebServiceException
XMLPart
getNumHeaderBlocks in interface XMLPartjavax.xml.ws.WebServiceException
public javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean consume)
throws javax.xml.ws.WebServiceException
XMLPart
getXMLStreamReader in interface XMLPartconsume - true if this is the last request on the Message
javax.xml.ws.WebServiceExceptionpublic boolean isConsumed()
XMLPart
isConsumed in interface XMLPart
public void outputTo(javax.xml.stream.XMLStreamWriter writer,
boolean consume)
throws javax.xml.stream.XMLStreamException,
javax.xml.ws.WebServiceException
XMLPart
outputTo in interface XMLPartwriter - XMLStreamWriterconsume - true if this is the last request on the block.
javax.xml.ws.WebServiceException
javax.xml.stream.XMLStreamException
public void removeBodyBlock(int index)
throws javax.xml.ws.WebServiceException
XMLPart
removeBodyBlock in interface XMLPartjavax.xml.ws.WebServiceException
public void removeHeaderBlock(java.lang.String namespace,
java.lang.String localPart)
throws javax.xml.ws.WebServiceException
XMLPart
removeHeaderBlock in interface XMLPartjavax.xml.ws.WebServiceException
public void setBodyBlock(int index,
Block block)
throws javax.xml.ws.WebServiceException
XMLPart
setBodyBlock in interface XMLPartjavax.xml.ws.WebServiceException
public void setHeaderBlock(java.lang.String namespace,
java.lang.String localPart,
Block block)
throws javax.xml.ws.WebServiceException
XMLPart
setHeaderBlock in interface XMLPartjavax.xml.ws.WebServiceException
public void appendHeaderBlock(java.lang.String namespace,
java.lang.String localPart,
Block block)
throws javax.xml.ws.WebServiceException
XMLPart
appendHeaderBlock in interface XMLPartjavax.xml.ws.WebServiceExceptionpublic java.lang.String traceString(java.lang.String indent)
XMLPart
traceString in interface XMLPart
public void addDataHandler(javax.activation.DataHandler dh,
java.lang.String id)
Message
addDataHandler in interface Messagedh - DataHandler (type of Attachment is inferred from dh.getContentType)id - String which is the Attachment content idaddAttachment(Attachment)public Message getParent()
XMLPart
getParent in interface XMLPartpublic void setParent(Message msg)
XMLPart
setParent in interface XMLPartpublic boolean isMTOMEnabled()
Message
isMTOMEnabled in interface Messagepublic void setMTOMEnabled(boolean b)
Message
setMTOMEnabled in interface Messagetrue - if the binding for this message indicates mtom
public XMLFault getXMLFault()
throws javax.xml.ws.WebServiceException
XMLPart
getXMLFault in interface XMLPartjavax.xml.ws.WebServiceExceptionXMLFault
public void setXMLFault(XMLFault xmlFault)
throws javax.xml.ws.WebServiceException
XMLPart
setXMLFault in interface XMLPartjavax.xml.ws.WebServiceExceptionXMLFault
public boolean isFault()
throws javax.xml.ws.WebServiceException
XMLPart
isFault in interface XMLPartjavax.xml.ws.WebServiceExceptionpublic java.lang.String getXMLPartContentType()
XMLPart
getXMLPartContentType in interface XMLPartpublic javax.jws.soap.SOAPBinding.Style getStyle()
getStyle in interface XMLPart
public void setStyle(javax.jws.soap.SOAPBinding.Style style)
throws javax.xml.ws.WebServiceException
XMLPart
setStyle in interface XMLPartstyle - Style
javax.xml.ws.WebServiceExceptionindirection
public javax.xml.namespace.QName getOperationElement()
throws javax.xml.ws.WebServiceException
getOperationElement in interface XMLPartjavax.xml.ws.WebServiceException
public void setOperationElement(javax.xml.namespace.QName operationQName)
throws javax.xml.ws.WebServiceException
XMLPart
setOperationElement in interface XMLPartjavax.xml.ws.WebServiceExceptionpublic java.util.Map getMimeHeaders()
getMimeHeaders in interface Messagepublic void setMimeHeaders(java.util.Map map)
Message
setMimeHeaders in interface Messagemap - Map
public Block getBodyBlock(java.lang.Object context,
BlockFactory blockFactory)
throws javax.xml.ws.WebServiceException
XMLPart
getBodyBlock in interface XMLPartjavax.xml.ws.WebServiceException
public void setBodyBlock(Block block)
throws javax.xml.ws.WebServiceException
XMLPart
setBodyBlock in interface XMLPartjavax.xml.ws.WebServiceExceptionpublic void setPostPivot()
Message
setPostPivot in interface Messagepublic boolean isPostPivot()
isPostPivot in interface Messagepublic int getIndirection()
XMLPart
getIndirection in interface XMLPartpublic void setIndirection(int indirection)
XMLPart
setIndirection in interface XMLPartindirection - (0 or 1)public MessageContext getMessageContext()
getMessageContext in interface Messagepublic void setMessageContext(MessageContext messageContext)
Message
setMessageContext in interface Messagepublic void setDoingSWA(boolean value)
Message
setDoingSWA in interface Messagepublic boolean isDoingSWA()
isDoingSWA in interface Messagepublic void close()
XMLPart
close in interface XMLPartpublic java.util.Set<javax.xml.namespace.QName> getHeaderQNames()
getHeaderQNames in interface XMLPart
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||