Holder for body elements.
addBodyElement
public SOAPBodyElement addBodyElement(Name name)
throws SOAPException
Creates a new SOAPBodyElement
object with the
specified name and adds it to this SOAPBody
object.
- addBodyElement in interface SOAPBody
name
- a Name
object with the name for the new
SOAPBodyElement
object
- the new
SOAPBodyElement
object
addChildElement
public SOAPElement addChildElement(String localName)
throws SOAPException
Creates a new SOAPElement
object initialized with the
given String
object and adds the new element to this
SOAPElement
object.
- addChildElement in interface SOAPElement
- addChildElement in interface MessageElement
localName
- a String
giving the local name for
the element
- the new
SOAPElement
object that was created
SOAPException
- if there is an error in creating the
SOAPElement
object
addChildElement
public SOAPElement addChildElement(String localName,
String prefix)
throws SOAPException
Creates a new SOAPElement
object initialized with the
specified local name and prefix and adds the new element to this
SOAPElement
object.
- addChildElement in interface SOAPElement
- addChildElement in interface MessageElement
localName
- a String
giving the local name for
the new elementprefix
- a String
giving the namespace prefix for
the new element
- the new
SOAPElement
object that was created
SOAPException
- if there is an error in creating the
SOAPElement
object
addChildElement
public SOAPElement addChildElement(String localName,
String prefix,
String uri)
throws SOAPException
Creates a new SOAPElement
object initialized with the
specified local name, prefix, and URI and adds the new element to this
SOAPElement
object.
- addChildElement in interface SOAPElement
- addChildElement in interface MessageElement
localName
- a String
giving the local name for
the new elementprefix
- a String
giving the namespace prefix for
the new elementuri
- a String
giving the URI of the namespace
to which the new element belongs
- the new
SOAPElement
object that was created
SOAPException
- if there is an error in creating the
SOAPElement
object
addChildElement
public SOAPElement addChildElement(SOAPElement element)
throws SOAPException
Add a
SOAPElement
as a child of this
SOAPElement
instance. The
SOAPElement
is expected to be created by a
SOAPElementFactory
. Callers should not rely on the
element instance being added as is into the XML
tree. Implementations could end up copying the content
of the
SOAPElement
passed into an instance of
a different
SOAPElement
implementation. For
instance if
addChildElement()
is called on a
SOAPHeader
,
element
will be copied
into an instance of a
SOAPHeaderElement
.
The fragment rooted in
element
is either added
as a whole or not at all, if there was an error.
The fragment rooted in
element
cannot contain
elements named "Envelope", "Header" or "Body" and in the SOAP
namespace. Any namespace prefixes present in the fragment
should be fully resolved using appropriate namespace
declarations within the fragment itself.
- addChildElement in interface SOAPElement
- addChildElement in interface MessageElement
element
- the SOAPElement
to be added as a
new child
- an instance representing the new SOAP element that was
actually added to the tree.
SOAPException
- if there was an error in adding this
element as a child
addDocument
public SOAPBodyElement addDocument(Document document)
throws SOAPException
Adds the root node of the DOM
Document
to this
SOAPBody
object.
Calling this method invalidates the
document
parameter. The
client application should discard all references to this
Document
and its contents upon calling
addDocument
. The behavior of an application that continues
to use such references is undefined.
- addDocument in interface SOAPBody
document
- the Document
object whose root node will be
added to this SOAPBody
- the
SOAPBodyElement
that represents the root node
that was added
addFault
public SOAPFault addFault(Name name,
String s)
throws SOAPException
Creates a new SOAPFault
object and adds it to this
SOAPBody
object. The new SOAPFault
will have a
faultcode
element that is set to the faultCode
parameter and a faultstring
set to faultstring
.
- addFault in interface SOAPBody
addFault
public SOAPFault addFault(Name name,
String s,
Locale locale)
throws SOAPException
Creates a new SOAPFault
object and adds it to this
SOAPBody
object. The new SOAPFault
will have a
faultcode
element that is set to the faultCode
parameter and a faultstring
set to faultstring
and localized to locale
.
- addFault in interface SOAPBody
locale
- a Locale
object indicating the native language
of the faultString
disableFormatting
public void disableFormatting()
getFault
public SOAPFault getFault()
Returns the SOAPFault
object in this SOAPBody
object.
- getFault in interface SOAPBody
- the
SOAPFault
object in this SOAPBody
object
hasFault
public boolean hasFault()
Indicates whether a SOAPFault
object exists in
this SOAPBody
object.
- hasFault in interface SOAPBody
true
if a SOAPFault
object exists in
this SOAPBody
object; false
otherwise
setSAAJEncodingCompliance
public void setSAAJEncodingCompliance(boolean comply)