org.apache.axis
public class SOAPPart extends SOAPPart implements Part
SOAPPart implements Part, providing common MIME operations.
SOAPPart also allows access to its envelope, as a string, byte[], InputStream, or SOAPEnvelope. (This functionality used to be in Message, and has been moved here more or less verbatim pending further cleanup.)
Field Summary | |
---|---|
static String | ALLOW_FORM_OPTIMIZATION
property used to set SOAPEnvelope as default form |
static int | FORM_BODYINSTREAM |
static int | FORM_BYTES |
static int | FORM_FAULT |
static int | FORM_INPUTSTREAM |
static int | FORM_OPTIMIZED |
static int | FORM_SOAPENVELOPE |
static int | FORM_STRING |
protected static Log | log |
protected Document | mDocument
SOAPEnvelope is the Document Elements of this XML docuement |
Constructor Summary | |
---|---|
SOAPPart(Message parent, Object initialContents, boolean isBodyStream)
Create a new SOAPPart.
|
Method Summary | |
---|---|
void | addMimeHeader(String header, String value)
Add the specified MIME header, as per JAXM.
|
Node | adoptNode(Node node) |
Node | appendChild(Node newChild) |
Node | cloneNode(boolean deep) |
short | compareDocumentPosition(Node other) |
Attr | createAttribute(String name) |
Attr | createAttributeNS(String namespaceURI, String qualifiedName) |
CDATASection | createCDATASection(String data) |
Comment | createComment(String data) |
DocumentFragment | createDocumentFragment() |
Element | createElement(String tagName) |
Element | createElementNS(String namespaceURI, String qualifiedName) |
EntityReference | createEntityReference(String name) |
ProcessingInstruction | createProcessingInstruction(String target, String data) |
Text | createTextNode(String data) |
Iterator | getAllMimeHeaders()
Retrieves all the headers for this SOAPPart
object as an iterator over the MimeHeader
objects. |
byte[] | getAsBytes()
Get the contents of this Part (not the headers!) |
SOAPEnvelope | getAsSOAPEnvelope()
Get the contents of this Part (not the MIME headers!) |
String | getAsString()
Get the contents of this Part (not the headers!) |
NamedNodeMap | getAttributes() |
String | getBaseURI()
DOM Level 3 stubs |
NodeList | getChildNodes() |
Source | getContent()
Returns the content of the SOAPEnvelope as a JAXP
Source object. |
String | getContentId()
Content ID.
|
String | getContentIdRef()
Content ID.
|
long | getContentLength()
Get the content length for this SOAPPart.
|
String | getContentLocation()
Content location.
|
String | getContentType()
Content type is always "text/xml" for SOAPParts.
|
int | getCurrentForm() |
Object | getCurrentMessage()
Get the current message, in whatever form it happens to be right now.
|
DocumentType | getDoctype() |
Element | getDocumentElement() |
String | getDocumentURI() |
DOMConfiguration | getDomConfig() |
Element | getElementById(String elementId) |
NodeList | getElementsByTagName(String tagname) |
NodeList | getElementsByTagNameNS(String namespaceURI, String localName) |
String | getEncoding() |
SOAPEnvelope | getEnvelope()
Gets the SOAPEnvelope object associated with
this SOAPPart object. |
Object | getFeature(String feature, String version) |
Node | getFirstChild() |
DOMImplementation | getImplementation() |
String | getInputEncoding() |
Node | getLastChild() |
String | getLocalName() |
Iterator | getMatchingMimeHeaders(String[] match)
Get all headers that match.
|
Message | getMessage()
Get the Message for this Part .
|
String[] | getMimeHeader(String name)
Gets all the values of the MimeHeader object
in this SOAPPart object that is identified by
the given String . |
String | getNamespaceURI() |
Node | getNextSibling() |
String | getNodeName()
Node Implementation |
short | getNodeType() |
String | getNodeValue() |
Iterator | getNonMatchingMimeHeaders(String[] match)
Get all headers that do not match.
|
Document | getOwnerDocument() |
Node | getParentNode() |
String | getPrefix() |
Node | getPreviousSibling() |
Document | getSOAPDocument() |
boolean | getStandalone() |
boolean | getStrictErrorChecking() |
String | getTextContent() |
Object | getUserData(String key) |
String | getVersion() |
String | getXmlEncoding() |
boolean | getXmlStandalone() |
String | getXmlVersion() |
boolean | hasAttributes() |
boolean | hasChildNodes() |
Node | importNode(Node importedNode, boolean deep) |
Node | insertBefore(Node newChild, Node refChild) |
boolean | isBodyStream() |
boolean | isDefaultNamespace(String namespaceURI) |
boolean | isEqualNode(Node arg) |
boolean | isSameNode(Node other) |
boolean | isSupported(String feature, String version) |
String | lookupNamespaceURI(String prefix) |
String | lookupPrefix(String namespaceURI) |
void | normalize() |
void | normalizeDocument() |
void | removeAllMimeHeaders()
Removes all the MimeHeader objects for this
SOAPEnvelope object. |
Node | removeChild(Node oldChild) |
void | removeMimeHeader(String header)
Removes all MIME headers that match the given name. |
Node | renameNode(Node n, String namespaceURI, String qualifiedName) |
Node | replaceChild(Node newChild, Node oldChild) |
void | saveChanges() |
void | setContent(Source source)
Sets the content of the SOAPEnvelope object
with the data from the given Source object. |
void | setContentId(String newCid)
Sets Content-Id of this part.
already defined. |
void | setContentLocation(String loc)
Set content location.
|
void | setCurrentMessage(Object currMsg, int form)
Set the current message |
void | setDocumentURI(String documentURI) |
void | setEncoding(String s) |
void | setMessage(Message msg)
Set the Message for this Part.
|
void | setMimeHeader(String name, String value)
Changes the first header entry that matches the given
header name so that its value is the given value, adding a
new header with the given name and value if no existing
header is a match. |
void | setNodeValue(String nodeValue) |
void | setPrefix(String prefix) |
void | setSOAPEnvelope(SOAPEnvelope env)
This set the SOAP Envelope for this part.
|
void | setStandalone(boolean flag) |
void | setStrictErrorChecking(boolean flag) |
void | setTextContent(String textContent) |
Object | setUserData(String key, Object data, UserDataHandler handler) |
void | setVersion(String s) |
void | setXmlStandalone(boolean xmlStandalone) |
void | setXmlVersion(String xmlVersion) |
void | writeTo(OutputStream os)
Write the contents to the specified stream.
|
void | writeTo(Writer writer)
Write the contents to the specified writer.
|
Do not call this directly! Should only be called by Message.
Parameters: parent the parent Message
initialContents the initial contens Object
isBodyStream if the body is in a stream
Parameters: header the header to add value the value of that header
Parameters: tagName
Returns:
Throws: DOMException
SOAPPart
object as an iterator over the MimeHeader
objects.Returns: an Iterator
object with all of the Mime
headers for this SOAPPart
object
Returns: an array of bytes containing a byte representation of this Part
Throws: AxisFault if this Part can't be serialized to the byte array
Returns: a SOAPEnvelope
containing the message content
Throws: AxisFault if the envelope could not be constructed
Returns: a String
containing the content of this message
Throws: AxisFault if there is an error serializing this part
Source
object.Returns: the content as a
javax.xml.transform.Source
object
Throws: SOAPException if the implementation cannot
convert the specified Source
object
See Also: setContent(javax.xml.transform.Source)
Returns: the content ID
Returns: the contentId reference value that should be used directly as an href in a SOAP element to reference this attachment. Not part of JAX-RPC, JAX-M, SAAJ, etc.
Returns: the content length in bytes
Returns: the content location
Returns: the content type
The method name is historical. TODO: rename this for clarity; should be more like getContents.
Returns: the current content
Returns:
SOAPEnvelope
object associated with
this SOAPPart
object. Once the SOAP envelope is
obtained, it can be used to get its contents.Returns: the SOAPEnvelope
object for this
SOAPPart
object
Throws: SOAPException if there is a SOAP error
Returns:
Parameters: match an array of String
s giving mime header names
Returns: an Iterator
over all values matching these headers
Message
for this Part
.
Returns: the Message
for this Part
MimeHeader
object
in this SOAPPart
object that is identified by
the given String
.Parameters: name the name of the header; example: "Content-Type"
Returns: a String
array giving all the values for
the specified header
Parameters: match an array of String
s giving mime header names
Returns: an Iterator
over all values not matching these
headers
Since: SAAJ 1.2
MimeHeader
objects for this
SOAPEnvelope
object.Parameters: header a String
giving
the name of the MIME header(s) to be removed
SOAPEnvelope
object
with the data from the given Source
object.Parameters: source javax.xml.transform.Source object with the data to be set
Throws: SOAPException if there is a problem in setting the source
See Also: getContent()
Parameters: newCid new Content-Id
Parameters: loc the content location
Parameters: currMsg form
Parameters: msg the Message
for this part
Note that RFC822 headers can contain only US-ASCII characters.
Parameters: name a String
giving the
header name for which to search value a String
giving the
value to be set. This value will be substituted for the
current value(s) of the first header that is a match if
there is one. If there is no match, this value will be
the value for a new MimeHeader
object.
@ throws java.lang.IllegalArgumentException if
there was a problem with the specified mime header name
or value
See Also: getMimeHeader(java.lang.String)
Note: It breaks the chicken/egg created. I need a message to create an attachment... From the attachment I should be able to get a reference... I now want to edit elements in the envelope in order to place the attachment reference to it. How do I now update the SOAP envelope with what I've changed?
Parameters: env the SOAPEnvelope
for this SOAPPart
Parameters: os the java.io.OutputStream
to write to
Parameters: writer the Writer
to write to