SOAPBody (Java Platform SE 8 ) (original) (raw)
- All Superinterfaces:
Element, Node, SOAPElement
public interface SOAPBody
extends SOAPElement
An object that represents the contents of the SOAP body element in a SOAP message. A SOAP body element consists of XML data that affects the way the application-specific content is processed.
A SOAPBody
object contains SOAPBodyElement
objects, which have the content for the SOAP body. A SOAPFault
object, which carries status and/or error information, is an example of a SOAPBodyElement
object.
See Also:
SOAPFault
Field Summary
* ### Fields inherited from interface org.w3c.dom.[Node](../../../org/w3c/dom/Node.html "interface in org.w3c.dom") `[ATTRIBUTE_NODE](../../../org/w3c/dom/Node.html#ATTRIBUTE%5FNODE), [CDATA_SECTION_NODE](../../../org/w3c/dom/Node.html#CDATA%5FSECTION%5FNODE), [COMMENT_NODE](../../../org/w3c/dom/Node.html#COMMENT%5FNODE), [DOCUMENT_FRAGMENT_NODE](../../../org/w3c/dom/Node.html#DOCUMENT%5FFRAGMENT%5FNODE), [DOCUMENT_NODE](../../../org/w3c/dom/Node.html#DOCUMENT%5FNODE), [DOCUMENT_POSITION_CONTAINED_BY](../../../org/w3c/dom/Node.html#DOCUMENT%5FPOSITION%5FCONTAINED%5FBY), [DOCUMENT_POSITION_CONTAINS](../../../org/w3c/dom/Node.html#DOCUMENT%5FPOSITION%5FCONTAINS), [DOCUMENT_POSITION_DISCONNECTED](../../../org/w3c/dom/Node.html#DOCUMENT%5FPOSITION%5FDISCONNECTED), [DOCUMENT_POSITION_FOLLOWING](../../../org/w3c/dom/Node.html#DOCUMENT%5FPOSITION%5FFOLLOWING), [DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC](../../../org/w3c/dom/Node.html#DOCUMENT%5FPOSITION%5FIMPLEMENTATION%5FSPECIFIC), [DOCUMENT_POSITION_PRECEDING](../../../org/w3c/dom/Node.html#DOCUMENT%5FPOSITION%5FPRECEDING), [DOCUMENT_TYPE_NODE](../../../org/w3c/dom/Node.html#DOCUMENT%5FTYPE%5FNODE), [ELEMENT_NODE](../../../org/w3c/dom/Node.html#ELEMENT%5FNODE), [ENTITY_NODE](../../../org/w3c/dom/Node.html#ENTITY%5FNODE), [ENTITY_REFERENCE_NODE](../../../org/w3c/dom/Node.html#ENTITY%5FREFERENCE%5FNODE), [NOTATION_NODE](../../../org/w3c/dom/Node.html#NOTATION%5FNODE), [PROCESSING_INSTRUCTION_NODE](../../../org/w3c/dom/Node.html#PROCESSING%5FINSTRUCTION%5FNODE), [TEXT_NODE](../../../org/w3c/dom/Node.html#TEXT%5FNODE)`
Method Summary
All Methods Instance Methods Abstract Methods
Modifier and Type Method Description 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. SOAPBodyElement addDocument(Document document) Adds the root node of the DOM Document 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 thisSOAPBody 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 thisSOAPBody object. Document extractContentAsDocument() Creates a new DOM Document and sets the first child of this SOAPBody as it's document element. SOAPFault getFault() Returns the SOAPFault object in this SOAPBody object. boolean hasFault() Indicates whether a SOAPFault object exists in thisSOAPBody object. * ### Methods inherited from interface javax.xml.soap.[SOAPElement](../../../javax/xml/soap/SOAPElement.html "interface in javax.xml.soap") `[addAttribute](../../../javax/xml/soap/SOAPElement.html#addAttribute-javax.xml.soap.Name-java.lang.String-), [addAttribute](../../../javax/xml/soap/SOAPElement.html#addAttribute-javax.xml.namespace.QName-java.lang.String-), [addChildElement](../../../javax/xml/soap/SOAPElement.html#addChildElement-javax.xml.soap.Name-), [addChildElement](../../../javax/xml/soap/SOAPElement.html#addChildElement-javax.xml.namespace.QName-), [addChildElement](../../../javax/xml/soap/SOAPElement.html#addChildElement-javax.xml.soap.SOAPElement-), [addChildElement](../../../javax/xml/soap/SOAPElement.html#addChildElement-java.lang.String-), [addChildElement](../../../javax/xml/soap/SOAPElement.html#addChildElement-java.lang.String-java.lang.String-), [addChildElement](../../../javax/xml/soap/SOAPElement.html#addChildElement-java.lang.String-java.lang.String-java.lang.String-), [addNamespaceDeclaration](../../../javax/xml/soap/SOAPElement.html#addNamespaceDeclaration-java.lang.String-java.lang.String-), [addTextNode](../../../javax/xml/soap/SOAPElement.html#addTextNode-java.lang.String-), [createQName](../../../javax/xml/soap/SOAPElement.html#createQName-java.lang.String-java.lang.String-), [getAllAttributes](../../../javax/xml/soap/SOAPElement.html#getAllAttributes--), [getAllAttributesAsQNames](../../../javax/xml/soap/SOAPElement.html#getAllAttributesAsQNames--), [getAttributeValue](../../../javax/xml/soap/SOAPElement.html#getAttributeValue-javax.xml.soap.Name-), [getAttributeValue](../../../javax/xml/soap/SOAPElement.html#getAttributeValue-javax.xml.namespace.QName-), [getChildElements](../../../javax/xml/soap/SOAPElement.html#getChildElements--), [getChildElements](../../../javax/xml/soap/SOAPElement.html#getChildElements-javax.xml.soap.Name-), [getChildElements](../../../javax/xml/soap/SOAPElement.html#getChildElements-javax.xml.namespace.QName-), [getElementName](../../../javax/xml/soap/SOAPElement.html#getElementName--), [getElementQName](../../../javax/xml/soap/SOAPElement.html#getElementQName--), [getEncodingStyle](../../../javax/xml/soap/SOAPElement.html#getEncodingStyle--), [getNamespacePrefixes](../../../javax/xml/soap/SOAPElement.html#getNamespacePrefixes--), [getNamespaceURI](../../../javax/xml/soap/SOAPElement.html#getNamespaceURI-java.lang.String-), [getVisibleNamespacePrefixes](../../../javax/xml/soap/SOAPElement.html#getVisibleNamespacePrefixes--), [removeAttribute](../../../javax/xml/soap/SOAPElement.html#removeAttribute-javax.xml.soap.Name-), [removeAttribute](../../../javax/xml/soap/SOAPElement.html#removeAttribute-javax.xml.namespace.QName-), [removeContents](../../../javax/xml/soap/SOAPElement.html#removeContents--), [removeNamespaceDeclaration](../../../javax/xml/soap/SOAPElement.html#removeNamespaceDeclaration-java.lang.String-), [setElementQName](../../../javax/xml/soap/SOAPElement.html#setElementQName-javax.xml.namespace.QName-), [setEncodingStyle](../../../javax/xml/soap/SOAPElement.html#setEncodingStyle-java.lang.String-)` * ### Methods inherited from interface javax.xml.soap.[Node](../../../javax/xml/soap/Node.html "interface in javax.xml.soap") `[detachNode](../../../javax/xml/soap/Node.html#detachNode--), [getParentElement](../../../javax/xml/soap/Node.html#getParentElement--), [getValue](../../../javax/xml/soap/Node.html#getValue--), [recycleNode](../../../javax/xml/soap/Node.html#recycleNode--), [setParentElement](../../../javax/xml/soap/Node.html#setParentElement-javax.xml.soap.SOAPElement-), [setValue](../../../javax/xml/soap/Node.html#setValue-java.lang.String-)` * ### Methods inherited from interface org.w3c.dom.[Element](../../../org/w3c/dom/Element.html "interface in org.w3c.dom") `[getAttribute](../../../org/w3c/dom/Element.html#getAttribute-java.lang.String-), [getAttributeNode](../../../org/w3c/dom/Element.html#getAttributeNode-java.lang.String-), [getAttributeNodeNS](../../../org/w3c/dom/Element.html#getAttributeNodeNS-java.lang.String-java.lang.String-), [getAttributeNS](../../../org/w3c/dom/Element.html#getAttributeNS-java.lang.String-java.lang.String-), [getElementsByTagName](../../../org/w3c/dom/Element.html#getElementsByTagName-java.lang.String-), [getElementsByTagNameNS](../../../org/w3c/dom/Element.html#getElementsByTagNameNS-java.lang.String-java.lang.String-), [getSchemaTypeInfo](../../../org/w3c/dom/Element.html#getSchemaTypeInfo--), [getTagName](../../../org/w3c/dom/Element.html#getTagName--), [hasAttribute](../../../org/w3c/dom/Element.html#hasAttribute-java.lang.String-), [hasAttributeNS](../../../org/w3c/dom/Element.html#hasAttributeNS-java.lang.String-java.lang.String-), [removeAttribute](../../../org/w3c/dom/Element.html#removeAttribute-java.lang.String-), [removeAttributeNode](../../../org/w3c/dom/Element.html#removeAttributeNode-org.w3c.dom.Attr-), [removeAttributeNS](../../../org/w3c/dom/Element.html#removeAttributeNS-java.lang.String-java.lang.String-), [setAttribute](../../../org/w3c/dom/Element.html#setAttribute-java.lang.String-java.lang.String-), [setAttributeNode](../../../org/w3c/dom/Element.html#setAttributeNode-org.w3c.dom.Attr-), [setAttributeNodeNS](../../../org/w3c/dom/Element.html#setAttributeNodeNS-org.w3c.dom.Attr-), [setAttributeNS](../../../org/w3c/dom/Element.html#setAttributeNS-java.lang.String-java.lang.String-java.lang.String-), [setIdAttribute](../../../org/w3c/dom/Element.html#setIdAttribute-java.lang.String-boolean-), [setIdAttributeNode](../../../org/w3c/dom/Element.html#setIdAttributeNode-org.w3c.dom.Attr-boolean-), [setIdAttributeNS](../../../org/w3c/dom/Element.html#setIdAttributeNS-java.lang.String-java.lang.String-boolean-)` * ### Methods inherited from interface org.w3c.dom.[Node](../../../org/w3c/dom/Node.html "interface in org.w3c.dom") `[appendChild](../../../org/w3c/dom/Node.html#appendChild-org.w3c.dom.Node-), [cloneNode](../../../org/w3c/dom/Node.html#cloneNode-boolean-), [compareDocumentPosition](../../../org/w3c/dom/Node.html#compareDocumentPosition-org.w3c.dom.Node-), [getAttributes](../../../org/w3c/dom/Node.html#getAttributes--), [getBaseURI](../../../org/w3c/dom/Node.html#getBaseURI--), [getChildNodes](../../../org/w3c/dom/Node.html#getChildNodes--), [getFeature](../../../org/w3c/dom/Node.html#getFeature-java.lang.String-java.lang.String-), [getFirstChild](../../../org/w3c/dom/Node.html#getFirstChild--), [getLastChild](../../../org/w3c/dom/Node.html#getLastChild--), [getLocalName](../../../org/w3c/dom/Node.html#getLocalName--), [getNamespaceURI](../../../org/w3c/dom/Node.html#getNamespaceURI--), [getNextSibling](../../../org/w3c/dom/Node.html#getNextSibling--), [getNodeName](../../../org/w3c/dom/Node.html#getNodeName--), [getNodeType](../../../org/w3c/dom/Node.html#getNodeType--), [getNodeValue](../../../org/w3c/dom/Node.html#getNodeValue--), [getOwnerDocument](../../../org/w3c/dom/Node.html#getOwnerDocument--), [getParentNode](../../../org/w3c/dom/Node.html#getParentNode--), [getPrefix](../../../org/w3c/dom/Node.html#getPrefix--), [getPreviousSibling](../../../org/w3c/dom/Node.html#getPreviousSibling--), [getTextContent](../../../org/w3c/dom/Node.html#getTextContent--), [getUserData](../../../org/w3c/dom/Node.html#getUserData-java.lang.String-), [hasAttributes](../../../org/w3c/dom/Node.html#hasAttributes--), [hasChildNodes](../../../org/w3c/dom/Node.html#hasChildNodes--), [insertBefore](../../../org/w3c/dom/Node.html#insertBefore-org.w3c.dom.Node-org.w3c.dom.Node-), [isDefaultNamespace](../../../org/w3c/dom/Node.html#isDefaultNamespace-java.lang.String-), [isEqualNode](../../../org/w3c/dom/Node.html#isEqualNode-org.w3c.dom.Node-), [isSameNode](../../../org/w3c/dom/Node.html#isSameNode-org.w3c.dom.Node-), [isSupported](../../../org/w3c/dom/Node.html#isSupported-java.lang.String-java.lang.String-), [lookupNamespaceURI](../../../org/w3c/dom/Node.html#lookupNamespaceURI-java.lang.String-), [lookupPrefix](../../../org/w3c/dom/Node.html#lookupPrefix-java.lang.String-), [normalize](../../../org/w3c/dom/Node.html#normalize--), [removeChild](../../../org/w3c/dom/Node.html#removeChild-org.w3c.dom.Node-), [replaceChild](../../../org/w3c/dom/Node.html#replaceChild-org.w3c.dom.Node-org.w3c.dom.Node-), [setNodeValue](../../../org/w3c/dom/Node.html#setNodeValue-java.lang.String-), [setPrefix](../../../org/w3c/dom/Node.html#setPrefix-java.lang.String-), [setTextContent](../../../org/w3c/dom/Node.html#setTextContent-java.lang.String-), [setUserData](../../../org/w3c/dom/Node.html#setUserData-java.lang.String-java.lang.Object-org.w3c.dom.UserDataHandler-)`
Method Detail
* #### addFault [SOAPFault](../../../javax/xml/soap/SOAPFault.html "interface in javax.xml.soap") addFault() throws [SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap") Creates a new `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. Returns: the new `SOAPFault` object Throws: `[SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap")` \- if there is a SOAP error * #### addFault [SOAPFault](../../../javax/xml/soap/SOAPFault.html "interface in javax.xml.soap") addFault([Name](../../../javax/xml/soap/Name.html "interface in javax.xml.soap") faultCode, [String](../../../java/lang/String.html "class in java.lang") faultString, [Locale](../../../java/util/Locale.html "class in java.util") locale) throws [SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap") Creates a new `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. Parameters: `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 use `faultString` \- a `String` giving an explanation of the fault `locale` \- a [Locale](../../../java/util/Locale.html "class in java.util") object indicating the native language of the `faultString` Returns: the new `SOAPFault` object Throws: `[SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap")` \- if there is a SOAP error Since: SAAJ 1.2 See Also: [SOAPFault.setFaultCode(javax.xml.soap.Name)](../../../javax/xml/soap/SOAPFault.html#setFaultCode-javax.xml.soap.Name-), [SOAPFault.setFaultString(java.lang.String)](../../../javax/xml/soap/SOAPFault.html#setFaultString-java.lang.String-) * #### addFault [SOAPFault](../../../javax/xml/soap/SOAPFault.html "interface in javax.xml.soap") addFault([QName](../../../javax/xml/namespace/QName.html "class in javax.xml.namespace") faultCode, [String](../../../java/lang/String.html "class in java.lang") faultString, [Locale](../../../java/util/Locale.html "class in java.util") locale) throws [SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap") Creates a new `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. Parameters: `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 fault `locale` \- a [Locale](../../../java/util/Locale.html "class in java.util") object indicating the native language of the `faultString` Returns: the new `SOAPFault` object Throws: `[SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap")` \- if there is a SOAP error Since: SAAJ 1.3 See Also: [SOAPFault.setFaultCode(javax.xml.soap.Name)](../../../javax/xml/soap/SOAPFault.html#setFaultCode-javax.xml.soap.Name-), [SOAPFault.setFaultString(java.lang.String)](../../../javax/xml/soap/SOAPFault.html#setFaultString-java.lang.String-), [addFault(Name faultCode, String faultString, Locale locale)](../../../javax/xml/soap/SOAPBody.html#addFault-javax.xml.soap.Name-java.lang.String-java.util.Locale-) * #### addFault [SOAPFault](../../../javax/xml/soap/SOAPFault.html "interface in javax.xml.soap") addFault([Name](../../../javax/xml/soap/Name.html "interface in javax.xml.soap") faultCode, [String](../../../java/lang/String.html "class in java.lang") faultString) throws [SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap") Creates a new `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. Parameters: `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 use `faultString` \- a `String` giving an explanation of the fault Returns: the new `SOAPFault` object Throws: `[SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap")` \- if there is a SOAP error Since: SAAJ 1.2 See Also: [SOAPFault.setFaultCode(javax.xml.soap.Name)](../../../javax/xml/soap/SOAPFault.html#setFaultCode-javax.xml.soap.Name-), [SOAPFault.setFaultString(java.lang.String)](../../../javax/xml/soap/SOAPFault.html#setFaultString-java.lang.String-) * #### addFault [SOAPFault](../../../javax/xml/soap/SOAPFault.html "interface in javax.xml.soap") addFault([QName](../../../javax/xml/namespace/QName.html "class in javax.xml.namespace") faultCode, [String](../../../java/lang/String.html "class in java.lang") faultString) throws [SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap") Creates a new `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 Parameters: `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 fault Returns: the new `SOAPFault` object Throws: `[SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap")` \- if there is a SOAP error Since: SAAJ 1.3 See Also: [SOAPFault.setFaultCode(javax.xml.soap.Name)](../../../javax/xml/soap/SOAPFault.html#setFaultCode-javax.xml.soap.Name-), [SOAPFault.setFaultString(java.lang.String)](../../../javax/xml/soap/SOAPFault.html#setFaultString-java.lang.String-), [addFault(Name faultCode, String faultString)](../../../javax/xml/soap/SOAPBody.html#addFault-javax.xml.soap.Name-java.lang.String-) * #### hasFault boolean hasFault() Indicates whether a `SOAPFault` object exists in this`SOAPBody` object. Returns: `true` if a `SOAPFault` object exists in this `SOAPBody` object; `false` otherwise * #### getFault [SOAPFault](../../../javax/xml/soap/SOAPFault.html "interface in javax.xml.soap") getFault() Returns the `SOAPFault` object in this `SOAPBody` object. Returns: the `SOAPFault` object in this `SOAPBody` object if present, null otherwise. * #### addBodyElement [SOAPBodyElement](../../../javax/xml/soap/SOAPBodyElement.html "interface in javax.xml.soap") addBodyElement([Name](../../../javax/xml/soap/Name.html "interface in javax.xml.soap") name) throws [SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap") Creates a new `SOAPBodyElement` object with the specified name and adds it to this `SOAPBody` object. Parameters: `name` \- a `Name` object with the name for the new `SOAPBodyElement` object Returns: the new `SOAPBodyElement` object Throws: `[SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap")` \- if a SOAP error occurs See Also: [addBodyElement(javax.xml.namespace.QName)](../../../javax/xml/soap/SOAPBody.html#addBodyElement-javax.xml.namespace.QName-) * #### addBodyElement [SOAPBodyElement](../../../javax/xml/soap/SOAPBodyElement.html "interface in javax.xml.soap") addBodyElement([QName](../../../javax/xml/namespace/QName.html "class in javax.xml.namespace") qname) throws [SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap") Creates a new `SOAPBodyElement` object with the specified QName and adds it to this `SOAPBody` object. Parameters: `qname` \- a `QName` object with the qname for the new`SOAPBodyElement` object Returns: the new `SOAPBodyElement` object Throws: `[SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap")` \- if a SOAP error occurs Since: SAAJ 1.3 See Also: [addBodyElement(Name)](../../../javax/xml/soap/SOAPBody.html#addBodyElement-javax.xml.soap.Name-) * #### addDocument [SOAPBodyElement](../../../javax/xml/soap/SOAPBodyElement.html "interface in javax.xml.soap") addDocument([Document](../../../org/w3c/dom/Document.html "interface in org.w3c.dom") document) throws [SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap") Adds the root node of the DOM `[Document](../../../org/w3c/dom/Document.html "interface in org.w3c.dom")` 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. Parameters: `document` \- the `Document` object whose root node will be added to this `SOAPBody`. Returns: the `SOAPBodyElement` that represents the root node that was added. Throws: `[SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap")` \- if the `Document` cannot be added Since: SAAJ 1.2 * #### extractContentAsDocument [Document](../../../org/w3c/dom/Document.html "interface in org.w3c.dom") extractContentAsDocument() throws [SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap") Creates a new DOM `[Document](../../../org/w3c/dom/Document.html "interface in org.w3c.dom")` and sets the first child of this `SOAPBody` as it's document element. The child `SOAPElement` is removed as part of the process. Returns: the `[Document](../../../org/w3c/dom/Document.html "interface in org.w3c.dom")` representation of the `SOAPBody` content. Throws: `[SOAPException](../../../javax/xml/soap/SOAPException.html "class in javax.xml.soap")` \- if there is not exactly one child `SOAPElement` of the `` `SOAPBody`. `` `Since: SAAJ 1.3 ` ``