SOAPMessage
object. All messages are required to have a SOAP part, so when a
SOAPMessage object is created, it will automatically
have a SOAPPart object.
A SOAPPart object is a MIME part and has the MIME headers
Content-Id, Content-Location, and Content-Type. Because the value of
Content-Type must be "text/xml", a SOAPPart object automatically
has a MIME header of Content-Type with its value set to "text/xml".
The value must be "text/xml" because content in the SOAP part of a
message must be in XML format. Content that is not of type "text/xml"
must be in an AttachmentPart object rather than in the
SOAPPart object.
When a message is sent, its SOAP part must have the MIME header Content-Type set to "text/xml". Or, from the other perspective, the SOAP part of any message that is received must have the MIME header Content-Type with a value of "text/xml".
A client can access the SOAPPart object of a
SOAPMessage object by
calling the method SOAPMessage.getSOAPPart. The
following line of code, in which message is a
SOAPMessage object, retrieves the SOAP part of a message.
SOAPPart soapPart = message.getSOAPPart();
A SOAPPart object contains a SOAPEnvelope object,
which in turn contains a SOAPBody object and a
SOAPHeader object.
The SOAPPart method getEnvelope can be used
to retrieve the SOAPEnvelope object.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract void | addMimeHeader(String
a name, String String giving the header namea value)String giving the value to be set
or addedCreates a |
| public abstract Iterator | Returns: anIterator object with all of the Mime
headers for this SOAPPart objectRetrieves all the headers for this |
| public abstract Source | Returns: the content as ajavax.xml.transform.Source objectReturns the content of the SOAPEnvelope as a JAXP |
| public String | Returns: aString giving the value of the MIME header
named "Content-Id"Retrieves the value of the MIME header whose name is "Content-Id". |
| public String | Returns: aString giving the value of the MIME header whose
name is "Content-Location"Retrieves the value of the MIME header whose name is "Content-Location". |
| public abstract SOAPEnvelope | Returns: theSOAPEnvelope object for this
SOAPPart objectGets the |
| public abstract Iterator | Returns: all of the MIME headers that match one of the names in the given array, returned as anIterator objecta names)String array with the name(s) of the
MIME headers to be returnedRetrieves all |
| public abstract String[] | Returns: aString array giving all the values for the
specified headerthe name of the header; example: "Content-Type" name)Gets all the values of the |
| public abstract Iterator | Returns: all of the MIME headers in thisSOAPPart object
except those that match one of the names in the
given array. The nonmatching MIME headers are returned as an
Iterator object.a names)String array with the name(s) of the
MIME headers not to be returnedRetrieves all |
| public abstract void | |
| public abstract void | removeMimeHeader(String
a header)String giving the name of the MIME header(s) to
be removedRemoves all MIME headers that match the given name. |
| public abstract void | setContent(Source
the source)javax.xml.transform.Source object with the
data to be setSets the content of the |
| public void | setContentId(String
a contentId)String giving the value of the MIME
header "Content-Id"Sets the value of the MIME header named "Content-Id"
to the given |
| public void | setContentLocation(String
a contentLocation)String giving the value
of the MIME
header "Content-Location"Sets the value of the MIME header "Content-Location"
to the given |
| public abstract void | setMimeHeader(String
a name, String String giving the header name
for which to searcha value)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.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. |
| SOAPPart | back to summary |
|---|---|
| protected SOAPPart() Default constructor. | |
| addMimeHeader | back to summary |
|---|---|
| public abstract void addMimeHeader(String name, String value) Creates a Note that RFC822 headers can contain only US-ASCII characters.
| |
| getAllMimeHeaders | back to summary |
|---|---|
| public abstract Iterator Retrieves all the headers for this
| |
| getContent | back to summary |
|---|---|
| public abstract Source getContent() throws SOAPException Returns the content of the SOAPEnvelope as a JAXP
| |
| getContentId | back to summary |
|---|---|
| public String getContentId() Retrieves the value of the MIME header whose name is "Content-Id".
| |
| getContentLocation | back to summary |
|---|---|
| public String getContentLocation() Retrieves the value of the MIME header whose name is "Content-Location".
| |
| getEnvelope | back to summary |
|---|---|
| public abstract SOAPEnvelope getEnvelope() throws SOAPException Gets the
| |
| getMatchingMimeHeaders | back to summary |
|---|---|
| public abstract Iterator Retrieves all
| |
| getMimeHeader | back to summary |
|---|---|
| public abstract String[] getMimeHeader(String name) Gets all the values of the
| |
| getNonMatchingMimeHeaders | back to summary |
|---|---|
| public abstract Iterator Retrieves all
| |
| removeAllMimeHeaders | back to summary |
|---|---|
| public abstract void removeAllMimeHeaders() Removes all the | |
| removeMimeHeader | back to summary |
|---|---|
| public abstract void removeMimeHeader(String header) Removes all MIME headers that match the given name.
| |
| setContent | back to summary |
|---|---|
| public abstract void setContent(Source source) throws SOAPException Sets the content of the
| |
| setContentId | back to summary |
|---|---|
| public void setContentId(String contentId) Sets the value of the MIME header named "Content-Id"
to the given
| |
| setContentLocation | back to summary |
|---|---|
| public void setContentLocation(String contentLocation) Sets the value of the MIME header "Content-Location"
to the given
| |
| setMimeHeader | back to summary |
|---|---|
| public abstract 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. If there is a match, this method clears all existing values for the first header that matches and sets the given value instead. If more than one header has the given name, this method removes all of the matching headers after the first one. Note that RFC822 headers can contain only US-ASCII characters.
| |