public class MessageImpl extends Object implements Message
| Modifier and Type | Method and Description |
|---|---|
void |
addDataHandler(DataHandler dh,
String id)
Add Attachment
|
void |
appendHeaderBlock(String namespace,
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
|
SOAPEnvelope |
getAsSOAPEnvelope()
getAsEnvelope Get the xml part as a read/write SOAPEnvelope
|
SOAPMessage |
getAsSOAPMessage()
getAsSOAPMessage Get the xml part as a read/write SOAPEnvelope
|
String |
getAttachmentID(int index)
Get the indicated (non-soap part) attachment id
|
String |
getAttachmentID(String partName)
Get the indicated (non-soap part) attachment id
|
List<String> |
getAttachmentIDs()
Get the list of attachment content ids for the message
|
Block |
getBodyBlock(int index,
Object context,
BlockFactory blockFactory)
getBodyBlock Get the body block at the specificed index.
|
Block |
getBodyBlock(Object context,
BlockFactory blockFactory)
getBodyBlock Get the single Body Block.
|
List<QName> |
getBodyBlockQNames()
getBodyBlockQNames
Calling this method will cache the OM.
|
DataHandler |
getDataHandler(String cid)
Get the attachment identified by the contentID
|
Block |
getHeaderBlock(String namespace,
String localPart,
Object context,
BlockFactory blockFactory)
getHeaderBlock
Get the firstheader block with the specified name.
|
List<Block> |
getHeaderBlocks(String namespace,
String localPart,
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.
|
Set<QName> |
getHeaderQNames() |
int |
getIndirection()
Get indirection.
|
MessageContext |
getMessageContext() |
Map |
getMimeHeaders() |
int |
getNumBodyBlocks()
getNumBodyBlocks Calling this method will cache the OM.
|
int |
getNumHeaderBlocks()
getNumHeaderBlocks
|
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.)
|
SOAPBinding.Style |
getStyle() |
Object |
getValue(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
|
String |
getXMLPartContentType()
The representation of the XMLPart may be in a number of different forms.
|
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(XMLStreamWriter writer,
boolean consume)
Write out the Message
|
void |
removeBodyBlock(int index)
removeBodyBlock Removes the indicated BodyBlock
|
DataHandler |
removeDataHandler(String cid)
Get the attachment and remove it from the Message
|
void |
removeHeaderBlock(String namespace,
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(String namespace,
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(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(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(SOAPBinding.Style style)
Set the Style.
|
void |
setXMLFault(XMLFault xmlFault)
Change the XMLPart so that it represents the fault described by XMLFault
|
String |
traceString(String indent)
Get a traceString...the trace string dumps the contents of the Block without forcing an
underlying ill-performant transformation of the message.
|
public SOAPMessage getAsSOAPMessage() throws WebServiceException
MessagegetAsSOAPMessage in interface MessageWebServiceExceptionpublic String getAttachmentID(int index)
getAttachmentID in interface Messageindex - public String getAttachmentID(String partName)
MessagegetAttachmentID in interface MessagepartName - (WS-I indicates that SWA attachments have a partName prefix)public Object getValue(Object context, BlockFactory blockFactory) throws WebServiceException
getValue in interface MessageWebServiceExceptionpublic List<String> getAttachmentIDs()
MessagegetAttachmentIDs in interface Messagepublic DataHandler getDataHandler(String cid)
MessagegetDataHandler in interface Messagepublic DataHandler removeDataHandler(String cid)
MessageremoveDataHandler in interface Messagepublic Protocol getProtocol()
MessagegetProtocol in interface MessagegetProtocol in interface XMLPartpublic org.apache.axiom.om.OMElement getAsOMElement()
throws WebServiceException
XMLPartgetAsOMElement in interface XMLPartWebServiceExceptionpublic SOAPEnvelope getAsSOAPEnvelope() throws WebServiceException
XMLPartgetAsSOAPEnvelope in interface XMLPartWebServiceExceptionpublic Block getBodyBlock(int index, Object context, BlockFactory blockFactory) throws WebServiceException
XMLPartgetBodyBlock in interface XMLPartWebServiceExceptiongetBodyBlockpublic Block getHeaderBlock(String namespace, String localPart, Object context, BlockFactory blockFactory) throws WebServiceException
XMLPartgetHeaderBlock in interface XMLPartWebServiceExceptionpublic List<Block> getHeaderBlocks(String namespace, String localPart, Object context, BlockFactory blockFactory, org.apache.axiom.soap.RolePlayer rolePlayer) throws WebServiceException
XMLPartgetHeaderBlocks in interface XMLPartnamespace - uri of headerlocalPart - local name of headercontext - context for blockFactoryblockFactory - kind of factory (i.e. JAXB)WebServiceExceptionpublic int getNumBodyBlocks()
throws WebServiceException
XMLPartgetNumBodyBlocks in interface XMLPartWebServiceExceptionpublic List<QName> getBodyBlockQNames() throws WebServiceException
XMLPartgetBodyBlockQNames in interface XMLPartWebServiceExceptionpublic int getNumHeaderBlocks()
throws WebServiceException
XMLPartgetNumHeaderBlocks in interface XMLPartWebServiceExceptionpublic XMLStreamReader getXMLStreamReader(boolean consume) throws WebServiceException
XMLPartgetXMLStreamReader in interface XMLPartconsume - true if this is the last request on the MessageWebServiceExceptionpublic boolean isConsumed()
XMLPartisConsumed in interface XMLPartpublic void outputTo(XMLStreamWriter writer, boolean consume) throws XMLStreamException, WebServiceException
XMLPartoutputTo in interface XMLPartwriter - XMLStreamWriterconsume - true if this is the last request on the block.WebServiceExceptionXMLStreamExceptionpublic void removeBodyBlock(int index)
throws WebServiceException
XMLPartremoveBodyBlock in interface XMLPartWebServiceExceptionpublic void removeHeaderBlock(String namespace, String localPart) throws WebServiceException
XMLPartremoveHeaderBlock in interface XMLPartWebServiceExceptionpublic void setBodyBlock(int index,
Block block)
throws WebServiceException
XMLPartsetBodyBlock in interface XMLPartWebServiceExceptionpublic void setHeaderBlock(String namespace, String localPart, Block block) throws WebServiceException
XMLPartsetHeaderBlock in interface XMLPartWebServiceExceptionpublic void appendHeaderBlock(String namespace, String localPart, Block block) throws WebServiceException
XMLPartappendHeaderBlock in interface XMLPartWebServiceExceptionpublic String traceString(String indent)
XMLParttraceString in interface XMLPartpublic void addDataHandler(DataHandler dh, String id)
MessageaddDataHandler in interface Messagedh - DataHandler (type of Attachment is inferred from dh.getContentType)id - String which is the Attachment content idaddAttachment(Attachment)public Message getParent()
XMLPartpublic void setParent(Message msg)
XMLPartpublic boolean isMTOMEnabled()
MessageisMTOMEnabled in interface Messagepublic void setMTOMEnabled(boolean b)
MessagesetMTOMEnabled in interface Messagetrue - if the binding for this message indicates mtompublic XMLFault getXMLFault() throws WebServiceException
XMLPartgetXMLFault in interface XMLPartWebServiceExceptionXMLFaultpublic void setXMLFault(XMLFault xmlFault) throws WebServiceException
XMLPartsetXMLFault in interface XMLPartWebServiceExceptionXMLFaultpublic boolean isFault()
throws WebServiceException
XMLPartisFault in interface XMLPartWebServiceExceptionpublic String getXMLPartContentType()
XMLPartgetXMLPartContentType in interface XMLPartpublic SOAPBinding.Style getStyle()
public void setStyle(SOAPBinding.Style style) throws WebServiceException
XMLPartsetStyle in interface XMLPartstyle - StyleWebServiceExceptionindirectionpublic QName getOperationElement() throws WebServiceException
getOperationElement in interface XMLPartWebServiceExceptionpublic void setOperationElement(QName operationQName) throws WebServiceException
XMLPartsetOperationElement in interface XMLPartWebServiceExceptionpublic Map getMimeHeaders()
getMimeHeaders in interface Messagepublic void setMimeHeaders(Map map)
MessagesetMimeHeaders in interface Messagemap - Mappublic Block getBodyBlock(Object context, BlockFactory blockFactory) throws WebServiceException
XMLPartgetBodyBlock in interface XMLPartWebServiceExceptionpublic void setBodyBlock(Block block) throws WebServiceException
XMLPartsetBodyBlock in interface XMLPartWebServiceExceptionpublic void setPostPivot()
MessagesetPostPivot in interface Messagepublic boolean isPostPivot()
isPostPivot in interface Messagepublic int getIndirection()
XMLPartgetIndirection in interface XMLPartpublic void setIndirection(int indirection)
XMLPartsetIndirection in interface XMLPartindirection - (0 or 1)public MessageContext getMessageContext()
getMessageContext in interface Messagepublic void setMessageContext(MessageContext messageContext)
MessagesetMessageContext in interface Messagepublic void setDoingSWA(boolean value)
MessagesetDoingSWA in interface Messagepublic boolean isDoingSWA()
isDoingSWA in interface Messagepublic void close()
XMLPartpublic Set<QName> getHeaderQNames()
getHeaderQNames in interface XMLPartCopyright © 2004–2020 The Apache Software Foundation. All rights reserved.