|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.xml.soap.SOAPPart | +--org.apache.axis.SOAPPart
The SOAPPart provides access to the root part of the Message which contains the envelope.
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 | |
protected static org.apache.commons.logging.Log |
log
|
Constructor Summary | |
SOAPPart(Message parent,
java.lang.Object initialContents,
boolean isBodyStream)
Do not call this directly! Should only be called by Message. |
Method Summary | |
void |
addMimeHeader(java.lang.String header,
java.lang.String value)
Add the specified MIME header, as per JAXM. |
java.util.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!), as a byte array. |
SOAPEnvelope |
getAsSOAPEnvelope()
Get the contents of this Part (not the MIME headers!), as a SOAPEnvelope. |
java.lang.String |
getAsString()
Get the contents of this Part (not the headers!), as a String. |
Source |
getContent()
Returns the content of the SOAPEnvelope as a JAXP
Source object. |
java.lang.String |
getContentId()
Content ID. |
java.lang.String |
getContentIdRef()
Content ID. |
int |
getContentLength()
Get the content length for this SOAPPart. |
java.lang.String |
getContentLocation()
Content location. |
java.lang.String |
getContentType()
Content type is always "text/xml" for SOAPParts. |
java.lang.Object |
getCurrentMessage()
Get the current message, in whatever form it happens to be right now. |
SOAPEnvelope |
getEnvelope()
Gets the SOAPEnvelope object associated with
this SOAPPart object. |
java.util.Iterator |
getMatchingMimeHeaders(java.lang.String[] match)
Get all headers that match |
Message |
getMessage()
Get the Message for this Part. |
java.lang.String[] |
getMimeHeader(java.lang.String name)
Gets all the values of the MimeHeader object
in this SOAPPart object that is identified by
the given String . |
java.util.Iterator |
getNonMatchingMimeHeaders(java.lang.String[] match)
Get all headers that do not match |
int |
getSize()
Get the total size in bytes, including headers, of this Part. |
void |
removeAllMimeHeaders()
Removes all the MimeHeader objects for this
SOAPEnvelope object. |
void |
removeMimeHeader(java.lang.String header)
Removes all MIME headers that match the given name. |
void |
setContent(Source source)
Sets the content of the SOAPEnvelope object
with the data from the given Source object. |
void |
setContentId(java.lang.String newCid)
Sets Content-Id of this part. |
void |
setContentLocation(java.lang.String loc)
Set content location. |
void |
setMessage(Message msg)
Set the Message for this Part. |
void |
setMimeHeader(java.lang.String name,
java.lang.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 |
setSOAPEnvelope(SOAPEnvelope env)
This set the SOAP Envelope for this part. |
void |
writeTo(java.io.Writer writer)
Write the contents to the specified writer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static org.apache.commons.logging.Log log
Constructor Detail |
public SOAPPart(Message parent, java.lang.Object initialContents, boolean isBodyStream)
Method Detail |
public Message getMessage()
public void setMessage(Message msg)
public java.lang.String getContentType()
getContentType
in interface Part
public int getContentLength()
public void setSOAPEnvelope(SOAPEnvelope env)
public int getSize()
public void writeTo(java.io.Writer writer) throws java.io.IOException
java.io.IOException
public java.lang.Object getCurrentMessage()
The method name is historical. TODO: rename this for clarity; should be more like getContents.
public byte[] getAsBytes() throws AxisFault
AxisFault
public java.lang.String getAsString() throws AxisFault
AxisFault
public SOAPEnvelope getAsSOAPEnvelope() throws AxisFault
AxisFault
public void addMimeHeader(java.lang.String header, java.lang.String value)
addMimeHeader
in interface Part
addMimeHeader
in class SOAPPart
header
- a String
giving the
header namevalue
- a String
giving the
value to be set or addedpublic java.lang.String getContentLocation()
getContentLocation
in interface Part
getContentLocation
in class SOAPPart
String
giving the value of the MIME
header whose name is "Content-Location"setContentLocation(java.lang.String)
public void setContentLocation(java.lang.String loc)
setContentLocation
in interface Part
setContentLocation
in class SOAPPart
loc
- a String
giving the value of the MIME header
"Content-Location"getContentLocation()
public void setContentId(java.lang.String newCid)
setContentId
in interface Part
setContentId
in class SOAPPart
newCid
- new Content-Idpublic java.lang.String getContentId()
getContentId
in interface Part
getContentId
in class SOAPPart
String
giving the value of the MIME
header named "Content-Id"setContentId(java.lang.String)
public java.lang.String getContentIdRef()
getContentIdRef
in interface Part
public java.util.Iterator getMatchingMimeHeaders(java.lang.String[] match)
getMatchingMimeHeaders
in interface Part
getMatchingMimeHeaders
in class SOAPPart
match
- a String
array with
the name(s) of the MIME headers to be returned
Iterator
objectpublic java.util.Iterator getNonMatchingMimeHeaders(java.lang.String[] match)
getNonMatchingMimeHeaders
in interface Part
getNonMatchingMimeHeaders
in class SOAPPart
match
- a String
array with
the name(s) of the MIME headers not to be returned
SOAPPart
object except those that match one of the names in the
given array. The nonmatching MIME headers are returned as
an Iterator
object.public void setContent(Source source) throws SOAPException
SOAPEnvelope
object
with the data from the given Source
object.
setContent
in class SOAPPart
source
- javax.xml.transform.Source object with the data to
be set
SOAPException
- if there is a problem in
setting the sourcegetContent()
public Source getContent() throws SOAPException
Source
object.
getContent
in class SOAPPart
javax.xml.transform.Source
object
SOAPException
- if the implementation cannot
convert the specified Source
objectsetContent(javax.xml.transform.Source)
public java.util.Iterator getAllMimeHeaders()
SOAPPart
object as an iterator over the MimeHeader
objects.
getAllMimeHeaders
in class SOAPPart
Iterator
object with all of the Mime
headers for this SOAPPart
objectpublic void setMimeHeader(java.lang.String name, java.lang.String value)
Note that RFC822 headers can contain only US-ASCII characters.
setMimeHeader
in class SOAPPart
name
- a String
giving the
header name for which to searchvalue
- 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.getMimeHeader(java.lang.String)
public java.lang.String[] getMimeHeader(java.lang.String name)
MimeHeader
object
in this SOAPPart
object that is identified by
the given String
.
getMimeHeader
in interface Part
getMimeHeader
in class SOAPPart
name
- the name of the header; example:
"Content-Type"
String
array giving all the values for
the specified headersetMimeHeader(java.lang.String, java.lang.String)
public void removeAllMimeHeaders()
MimeHeader
objects for this
SOAPEnvelope
object.
removeAllMimeHeaders
in class SOAPPart
public void removeMimeHeader(java.lang.String header)
removeMimeHeader
in class SOAPPart
header
- a String
giving
the name of the MIME header(s) to be removedpublic SOAPEnvelope getEnvelope() throws SOAPException
SOAPEnvelope
object associated with
this SOAPPart
object. Once the SOAP envelope is
obtained, it can be used to get its contents.
getEnvelope
in class SOAPPart
SOAPEnvelope
object for this
SOAPPart
object
SOAPException
- if there is a SOAP error
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |