public class SOAPBodyImpl extends SOAPElementImpl implements SOAPBody
domNode, soapParent
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
SOAPBodyImpl(String prefix,
String namespace) |
Modifier and Type | Method and Description |
---|---|
SOAPElement |
addAttribute(Name name,
String value)
Adds an attribute with the specified name and value to this SOAPElement object.
|
SOAPBodyElement |
addBodyElement(Name name)
Creates a new
SOAPBodyElement object with the specified
name and adds it to this SOAPBody object. |
SOAPBodyElement |
addBodyElement(QName qname)
Creates a new
SOAPBodyElement object with the specified
QName and adds it to this SOAPBody object. |
SOAPElement |
addChildElement(SOAPElement child)
Convert the child into a SOAPBodyElement
|
SOAPBodyElement |
addDocument(Document doc)
Adds the root node of the DOM
to this SOAPBody object. |
SOAPFault |
addFault()
Creates a new
SOAPFault object and adds it to
this SOAPBody object. |
SOAPFault |
addFault(Name faultCode,
String faultString)
Creates a new
SOAPFault object and adds it to this
SOAPBody object. |
SOAPFault |
addFault(Name faultCode,
String faultString,
Locale locale)
Creates a new
SOAPFault object and adds it to
this SOAPBody object. |
SOAPFault |
addFault(QName faultCode,
String faultString)
Creates a new
SOAPFault object and adds it to this SOAPBody
object. |
SOAPFault |
addFault(QName faultCode,
String faultString,
Locale locale)
Creates a new
SOAPFault object and adds it to this
SOAPBody object. |
Node |
appendChild(Node newChild) |
Document |
extractContentAsDocument()
Creates a new DOM
and sets
the first child of this SOAPBody as it's document
element. |
SOAPBodyElement |
getBodyElement() |
SOAPFault |
getFault()
Returns the
SOAPFault object in this SOAPBody
object. |
boolean |
hasFault()
Indicates whether a
SOAPFault object exists in this
SOAPBody object. |
Node |
insertBefore(Node newChild,
Node refChild) |
Node |
replaceChild(Node newChild,
Node oldChild) |
addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, createQName, getAllAttributes, getAllAttributesAsQNames, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributeValue, getAttributeValue, getChildElements, getChildElements, getChildElements, getElementName, getElementQName, getElementsByTagName, getElementsByTagNameNS, getEncodingStyle, getFirstChildElementByLocalName, getNamespacePrefixes, getNamespaceURI, getSchemaTypeInfo, getSOAPEnvelope, getTagName, getVisibleNamespacePrefixes, hasAttribute, hasAttributeNS, removeAttribute, removeAttribute, removeAttribute, removeAttributeNode, removeAttributeNS, removeContents, removeNamespaceDeclaration, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setElementQName, setElementQNameInternal, setEncodingStyle, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setPrefix, writeElement, writeElementContent
cloneNode, compareDocumentPosition, detachNode, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, getValue, hasAttributes, hasChildNodes, hashCode, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, recycleNode, removeChild, setNodeValue, setParentElement, setTextContent, setUserData, setValue, toString
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, createQName, getAllAttributes, getAllAttributesAsQNames, getAttributeValue, getAttributeValue, getChildElements, getChildElements, getChildElements, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration, setElementQName, setEncodingStyle
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, setNodeValue, setPrefix, setTextContent, setUserData
public SOAPElement addChildElement(SOAPElement child) throws SOAPException
addChildElement
in interface SOAPElement
addChildElement
in class SOAPElementImpl
child
- the SOAPElement to be added as a new childSOAPException
- if there was an error in adding this
element as a childpublic SOAPBodyElement addBodyElement(Name name) throws SOAPException
SOAPBody
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
objectSOAPBodyElement
objectSOAPException
- if a SOAP error occursSOAPBody.addBodyElement(javax.xml.namespace.QName)
public SOAPBodyElement addBodyElement(QName qname) throws SOAPException
SOAPBody
SOAPBodyElement
object with the specified
QName and adds it to this SOAPBody
object.addBodyElement
in interface SOAPBody
qname
- a QName
object with the qname for the new
SOAPBodyElement
objectSOAPBodyElement
objectSOAPException
- if a SOAP error occursSOAPBody.addBodyElement(Name)
public SOAPBodyElement addDocument(Document doc) throws SOAPException
SOAPBody
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
doc
- the Document
object whose root node will be
added to this SOAPBody
.SOAPBodyElement
that represents the root node
that was added.SOAPException
- if the Document
cannot be addedpublic SOAPFault addFault() throws SOAPException
SOAPBody
SOAPFault
object and adds it to
this SOAPBody
object. The new SOAPFault
will
have default values set for the mandatory child elements. The type of
the SOAPFault
will be a SOAP 1.1 or a SOAP 1.2 SOAPFault
depending on the protocol
specified while creating the
MessageFactory
instance.
A SOAPBody
may contain at most one SOAPFault
child element.
addFault
in interface SOAPBody
SOAPFault
objectSOAPException
- if there is a SOAP errorpublic SOAPFault addFault(Name faultCode, String faultString) throws SOAPException
SOAPBody
SOAPFault
object and adds it to this
SOAPBody
object. The type of the SOAPFault
will be a SOAP 1.1 or a SOAP 1.2 SOAPFault
depending on
the protocol
specified while creating the MessageFactory
instance.
For SOAP 1.2 the faultCode
parameter is the value of the
Fault/Code/Value element and the faultString
parameter
is the value of the Fault/Reason/Text element. For SOAP 1.1
the faultCode
parameter is the value of the faultcode
element and the faultString
parameter is the value of the faultstring
element.
In case of a SOAP 1.2 fault, the default value for the mandatory xml:lang
attribute on the Fault/Reason/Text element will be set to
java.util.Locale.getDefault()
A SOAPBody
may contain at most one SOAPFault
child element.
addFault
in interface SOAPBody
faultCode
- a Name
object giving the fault code to be set;
must be one of the fault codes defined in the version of SOAP
specification in usefaultString
- a String
giving an explanation of the faultSOAPFault
objectSOAPException
- if there is a SOAP errorSOAPFault.setFaultCode(javax.xml.soap.Name)
,
SOAPFault.setFaultString(java.lang.String)
public SOAPFault addFault(QName faultCode, String faultString) throws SOAPException
SOAPBody
SOAPFault
object and adds it to this SOAPBody
object. The type of the SOAPFault
will be a SOAP 1.1 or a SOAP 1.2 SOAPFault
depending on
the protocol
specified while creating the MessageFactory
instance.
For SOAP 1.2 the faultCode
parameter is the value of the
Fault/Code/Value element and the faultString
parameter
is the value of the Fault/Reason/Text element. For SOAP 1.1
the faultCode
parameter is the value of the faultcode
element and the faultString
parameter is the value of the faultstring
element.
In case of a SOAP 1.2 fault, the default value for the mandatory xml:lang
attribute on the Fault/Reason/Text element will be set to
java.util.Locale.getDefault()
A SOAPBody
may contain at most one SOAPFault
child element
addFault
in interface SOAPBody
faultCode
- a QName
object giving the fault code to be
set; must be one of the fault codes defined in the version
of SOAP specification in usefaultString
- a String
giving an explanation of the faultSOAPFault
objectSOAPException
- if there is a SOAP errorSOAPFault.setFaultCode(javax.xml.soap.Name)
,
SOAPFault.setFaultString(java.lang.String)
,
SOAPBody.addFault(Name faultCode, String faultString)
public SOAPFault addFault(Name faultCode, String faultString, Locale locale) throws SOAPException
SOAPBody
SOAPFault
object and adds it to
this SOAPBody
object. The type of the
SOAPFault
will be a SOAP 1.1 or a SOAP 1.2
SOAPFault
depending on the protocol
specified while creating the MessageFactory
instance.
For SOAP 1.2 the faultCode
parameter is the value of the
Fault/Code/Value element and the faultString
parameter
is the value of the Fault/Reason/Text element. For SOAP 1.1
the faultCode
parameter is the value of the faultcode
element and the faultString
parameter is the value of the faultstring
element.
A SOAPBody
may contain at most one SOAPFault
child element.
addFault
in interface SOAPBody
faultCode
- a Name
object giving the fault
code to be set; must be one of the fault codes defined in the Version
of SOAP specification in usefaultString
- a String
giving an explanation of
the faultlocale
- a Locale
object indicating
the native language of the faultString
SOAPFault
objectSOAPException
- if there is a SOAP errorSOAPFault.setFaultCode(javax.xml.soap.Name)
,
SOAPFault.setFaultString(java.lang.String)
public SOAPFault addFault(QName faultCode, String faultString, Locale locale) throws SOAPException
SOAPBody
SOAPFault
object and adds it to this
SOAPBody
object. The type of the SOAPFault
will be a SOAP 1.1 or a SOAP 1.2 SOAPFault
depending on
the protocol
specified while creating the MessageFactory
instance.
For SOAP 1.2 the faultCode
parameter is the value of the
Fault/Code/Value element and the faultString
parameter
is the value of the Fault/Reason/Text element. For SOAP 1.1
the faultCode
parameter is the value of the faultcode
element and the faultString
parameter is the value of the faultstring
element.
A SOAPBody
may contain at most one SOAPFault
child element.
addFault
in interface SOAPBody
faultCode
- a QName
object giving the fault code to be
set; must be one of the fault codes defined in the version
of SOAP specification in use.faultString
- a String
giving an explanation of the faultlocale
- a Locale
object indicating the
native language of the faultString
SOAPFault
objectSOAPException
- if there is a SOAP errorSOAPFault.setFaultCode(javax.xml.soap.Name)
,
SOAPFault.setFaultString(java.lang.String)
,
SOAPBody.addFault(Name faultCode, String faultString, Locale locale)
public SOAPFault getFault()
SOAPBody
SOAPFault
object in this SOAPBody
object.public boolean hasFault()
SOAPBody
SOAPFault
object exists in this
SOAPBody
object.public SOAPBodyElement getBodyElement()
public Node appendChild(Node newChild) throws DOMException
appendChild
in interface Node
appendChild
in class NodeImpl
DOMException
public Node insertBefore(Node newChild, Node refChild) throws DOMException
insertBefore
in interface Node
insertBefore
in class NodeImpl
DOMException
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
replaceChild
in interface Node
replaceChild
in class NodeImpl
DOMException
public SOAPElement addAttribute(Name name, String value) throws SOAPException
SOAPElementImpl
addAttribute
in interface SOAPElement
addAttribute
in class SOAPElementImpl
name
- a Name object with the name of the attributevalue
- a String giving the value of the attributeSOAPException
- if there is an error in creating the
Attribute, or it is invalid to set
an attribute with Name
name
on this SOAPElement.SOAPElement.addAttribute(javax.xml.namespace.QName, String)
public Document extractContentAsDocument() throws SOAPException
SOAPBody
Document
and sets
the first child of this SOAPBody
as it's document
element. The child SOAPElement
is removed as part of the
process.extractContentAsDocument
in interface SOAPBody
Document
representation
of the SOAPBody
content.SOAPException
- if there is not exactly one child SOAPElement
of the
SOAPBody
.
Copyright © 2018 JBoss by Red Hat. All rights reserved.