|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectelectric.soap.SOAPMessage
SOAPMessage represents a SOAPMessage, and includes methods for manipulating all of its aspects, including its XML document, XML envelope, XML body, XML fault, MIME attachments and MIME headers.
Field Summary |
Fields inherited from interface electric.soap.ISOAPConstants |
ACTOR, ASYNC, BODY, DETAIL, ENCODING_STYLE, ENVELOPE, EXCEPTION, FAULT, FAULT_ACTOR, FAULT_CODE, FAULT_STRING, GET_SOAP_ACTOR, GET_SOAP_CODE, HEADER, MUST_UNDERSTAND, NEXT_ACTOR, OPTIMIZED_HEADER, SET_SOAP_ACTOR, SET_SOAP_CODE, SET_SOAP_DETAIL, SOAP_ACTION_HEADER, SOAP_BINDING, SOAP_ENCODING, SOAP_ENCODING_PREFIX, SOAP_ENVELOPE, SOAP_HTTP_TRANSPORT, SOAP_PREFIX, SOAP11_BINDING, SOAP11_ENCODING, SOAP11_ENVELOPE, SOAP12, SOAP12_BINDING, SOAP12_ENCODING, SOAP12_ENVELOPE, SOAP12_HTTP_CONTENT_TYPE, STACKTRACE, TME_PREFIX, UNDERSTOOD, XSD_PREFIX, XSI_PREFIX, XSI_SUFFIX |
Fields inherited from interface electric.util.mime.IMIMEConstants |
DATA_DIRECTORY, DEFAULT_MIMEDATA_DIRECTORY, DEFAULT_START_MIME_PART, MIME_ATTACHMENT_STYLE, MIME_EXTENSION, STAR_SLASH_STAR_DATAHANDLER |
Constructor Summary | |
SOAPMessage()
Construct a SOAP message with no associated XML document. |
|
SOAPMessage(java.lang.Throwable exception)
Construct a SOAP message for the given exception. |
Method Summary | |
void |
addAttachment(MIMEData attachment)
Add the specified attachment. |
Element |
addBody()
Add a body if one doesn't already exist, then return the body. |
Element |
addEnvelope()
Add an envelope if one doesn't already exist, then return the envelope. |
Element |
addFault()
Add a fault if one doesn't already exist, then return the fault. |
Element |
addHeader()
Add a header if one doesn't already exist, then return the header. |
void |
addHeaderElement(Element element)
Add the specified header element. |
void |
addMIMEHeader(java.lang.String name,
java.lang.String value)
Add a MIME header with the specified name and value. |
void |
deoptimize()
If this message is optimized, undo the optimization by wrapping my payload in a standard SOAP body. |
MIMEData[] |
getAttachments()
Return an array of all my attachments, or null if I have none. |
java.lang.String |
getAttachmentStyle()
|
Element |
getBody()
Return my body, or null if none exists. |
ByteArray |
getByteArray()
Return a ByteArray version of my XML document. |
ByteArray |
getByteArray(WSDL wsdl)
|
byte[] |
getBytes()
Return a byte array version of my XML document. |
Context |
getContext()
|
Document |
getDocument()
Return my XML document. |
java.lang.String |
getEncodingStyle()
|
Element |
getEnvelope()
Return my envelope, or null if one doesn't exist. |
java.lang.String |
getEnvelopeNamespace()
Return the envelope namespace. |
java.lang.Throwable |
getException()
If I have a fault, return the exception that it represents, otherwise return null. |
Element |
getFault()
Return my fault, or null if none exists. |
Element |
getHeader()
Return my header, or null if none exists. |
Element |
getHeaderElement(java.lang.String name)
Return the first header element with the specified name, or null if none exists. |
Element |
getHeaderElement(java.lang.String namespace,
java.lang.String name)
Return the first header element with the specified namespace an name, or null if none exists. |
Elements |
getHeaderElements()
Return an enumeration of my header elements. |
Elements |
getHeaderElements(java.lang.String name)
Return an enumeration of my header elements that have the specified name. |
Elements |
getHeaderElements(java.lang.String namespace,
java.lang.String name)
Return an enumeration of my header elements that have the specified namespace and name. |
Elements |
getHeaderElementsForSOAPActor(java.lang.String actor)
Return an enumeration of my header elements which are aimed at an actor. |
java.lang.String |
getMIMEHeader(java.lang.String name)
Return the first MIME header with the specified name. |
MIMEHeaders |
getMIMEHeaders()
Return my MIME headers, or null if I have none. |
java.util.Enumeration |
getMIMEHeaders(java.lang.String name)
Return an enumeration over the MIME headers with the specified name. |
SOAPOptimizations |
getOptimizations()
|
Element |
getRoot()
Return the root of my XML document, or null if I have no document. |
SOAPException |
getSOAPException()
If I have a fault, return the exception that it represents as a SOAPException, otherwise return null. |
java.lang.String |
getSoapVersion()
Return the namespace used for the soap:envelope as a proxy for the version of SOAP being used. |
boolean |
hasAttachment(java.lang.String contentID)
|
boolean |
hasAttachments()
Return true I have one or more attachments. |
boolean |
hasFault()
Return true if I have a fault. |
boolean |
isException()
Return true if I have a fault. |
void |
removeAttachment(MIMEData attachment)
Remove the specified attachment. |
void |
removeAttachments()
Remove all the attachments. |
Element |
removeBody()
If I have a body, remove and return it, otherwise return null. |
Element |
removeEnvelope()
If I have an envelope, remove and return it, otherwise return null. |
Element |
removeFault()
If I have a fault, remove and return it, otherwise return null. |
Element |
removeHeader()
If I have a header, remove and return it, otherwise return null. |
void |
removeHeaderElement(Element element)
Remove the specified header element. |
void |
removeHeaderElement(java.lang.String name)
Remove the first header element with the specified name. |
void |
removeHeaderElement(java.lang.String namespace,
java.lang.String name)
Remove the first header element with the specified namespace and name. |
void |
removeHeaderElements()
Remove all the header elements. |
void |
removeHeaderElements(java.lang.String name)
Remove the header elements with the specified name. |
void |
removeHeaderElements(java.lang.String namespace,
java.lang.String name)
Remove the header elements with the specified namespace and name. |
void |
removeMIMEHeader(java.lang.String name)
Remove the first MIME header with the specified name. |
void |
removeMIMEHeaders()
Remove all MIME headers. |
void |
removeMIMEHeaders(java.lang.String name)
Remove all the MIME headers with the specified name. |
void |
setAttachments(MIMEData[] attachments)
Set my attachments. |
void |
setAttachmentStyle(java.lang.String attachmentStyle)
|
void |
setBody(Element body)
Set my body. |
void |
setBytes(byte[] bytes)
Set my XML document to a parsed version of the specified bytes. |
void |
setBytes(byte[] bytes,
SOAPOptimizations optimizations,
WSDL wsdl)
Set my XML document to a parsed version of the specified bytes. |
void |
setContext(Context context)
|
void |
setDocument(Document document)
Set my XML document. |
void |
setDocument(Document document,
SOAPOptimizations optimizations)
Set my XML document. |
void |
setEnvelope(Element envelope)
Set my envelope. |
void |
setException(java.lang.Throwable exception)
Set my fault to represent the specified exception. |
void |
setFault(Element fault)
Set my fault. |
void |
setHeader(Element header)
Set my header. |
void |
setMIMEHeader(java.lang.String name,
java.lang.String value)
Add a MIME header with the specified name and value, replacing any existing MIME headers with the same name. |
void |
setSoapVersion(java.lang.String soapVersion)
Set the SOAP version. |
int |
size()
|
java.lang.String |
toString()
Return an indented version of my XML document. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SOAPMessage()
public SOAPMessage(java.lang.Throwable exception)
exception
- Method Detail |
public java.lang.String toString()
public int size()
public SOAPOptimizations getOptimizations()
public void deoptimize()
public Document getDocument()
public Element getRoot()
public void setDocument(Document document)
document
- A document that represents a SOAP message.public void setDocument(Document document, SOAPOptimizations optimizations)
document
- A document representing an optimized SOAP message.optimizations
- public ByteArray getByteArray() throws java.io.IOException
java.io.IOException
public ByteArray getByteArray(WSDL wsdl) throws java.io.IOException
wsdl
-
java.io.IOException
public byte[] getBytes() throws java.io.IOException
java.io.IOException
public void setBytes(byte[] bytes) throws ParseException
bytes
- The bytes.
ParseException
- If an error occurs during the parsing process.public void setBytes(byte[] bytes, SOAPOptimizations optimizations, WSDL wsdl) throws ParseException, java.io.UnsupportedEncodingException
bytes
- The bytes.optimizations
- wsdl
-
ParseException
- If an error occurs during the parsing process.
java.io.UnsupportedEncodingException
public Element getEnvelope()
public void setEnvelope(Element envelope)
envelope
- The new value.public Element removeEnvelope()
public Element addEnvelope()
public Element getBody()
public java.lang.String getEnvelopeNamespace()
public void setBody(Element body)
body
- The new value.public Element removeBody()
public Element addBody()
public Element getFault()
public void setFault(Element fault)
fault
- The new value.public Element removeFault()
public Element addFault()
public boolean hasFault()
public java.lang.Throwable getException()
public SOAPException getSOAPException()
public boolean isException()
public void setException(java.lang.Throwable exception)
exception
- The exception.
todo: deprecate and make clear this is "setGenericException"public Element getHeader()
public void setHeader(Element header)
header
- The new value.public Element removeHeader()
public Element addHeader()
public Element getHeaderElement(java.lang.String name)
name
- The name.public Element getHeaderElement(java.lang.String namespace, java.lang.String name)
namespace
- The namespace.name
- The name.public Elements getHeaderElements()
public Elements getHeaderElementsForSOAPActor(java.lang.String actor)
actor
- The URI of the soap actor you're looking forpublic Elements getHeaderElements(java.lang.String name)
name
- The name.public Elements getHeaderElements(java.lang.String namespace, java.lang.String name)
namespace
- The namespace.name
- The name.public void addHeaderElement(Element element)
element
- The element.public void removeHeaderElement(Element element)
element
- The element.public void removeHeaderElement(java.lang.String name)
name
- The name.public void removeHeaderElement(java.lang.String namespace, java.lang.String name)
namespace
- The namespace.name
- The name.public void removeHeaderElements(java.lang.String name)
name
- The name.public void removeHeaderElements(java.lang.String namespace, java.lang.String name)
namespace
- The namespace.name
- The name.public void removeHeaderElements()
public MIMEData[] getAttachments()
public void setAttachments(MIMEData[] attachments)
attachments
- The new value.public boolean hasAttachments()
public boolean hasAttachment(java.lang.String contentID)
contentID
- public void addAttachment(MIMEData attachment)
attachment
- The attachment.public void removeAttachment(MIMEData attachment)
attachment
- The attachment.public void removeAttachments()
public java.lang.String getAttachmentStyle()
public void setAttachmentStyle(java.lang.String attachmentStyle)
attachmentStyle
- public void addMIMEHeader(java.lang.String name, java.lang.String value)
name
- The name.value
- The value.public void setMIMEHeader(java.lang.String name, java.lang.String value)
name
- The name.value
- The value.public java.lang.String getMIMEHeader(java.lang.String name)
name
- The name.public java.util.Enumeration getMIMEHeaders(java.lang.String name)
name
- The name.public MIMEHeaders getMIMEHeaders()
public void removeMIMEHeader(java.lang.String name)
name
- The name.public void removeMIMEHeaders(java.lang.String name)
name
- The name.public void removeMIMEHeaders()
public java.lang.String getEncodingStyle()
public java.lang.String getSoapVersion()
public void setSoapVersion(java.lang.String soapVersion)
soapVersion
- SOAP_ENVELOPE or SOAP12_ENVELOPE.public Context getContext()
getContext
in interface IContextHolder
public void setContext(Context context)
setContext
in interface IContextHolder
context
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |