- All Superinterfaces:
Element,Node,Node,SOAPElement
- All Known Implementing Classes:
Body1_1Impl,Body1_2Impl,BodyImpl
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.
- Since:
- 1.6
- See Also:
-
Field Summary
Fields inherited from interface org.w3c.dom.Node
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 -
Method Summary
Modifier and TypeMethodDescriptionaddBodyElement(Name name) Creates a newSOAPBodyElementobject with the specified name and adds it to thisSOAPBodyobject.addBodyElement(QName qname) Creates a newSOAPBodyElementobject with the specified QName and adds it to thisSOAPBodyobject.addDocument(Document document) Adds the root node of the DOMDocumentto thisSOAPBodyobject.addFault()Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.Creates a new DOMDocumentand sets the first child of thisSOAPBodyas it's document element.getFault()Returns theSOAPFaultobject in thisSOAPBodyobject.booleanhasFault()Indicates whether aSOAPFaultobject exists in thisSOAPBodyobject.Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNSMethods inherited from interface jakarta.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValueMethods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserDataMethods inherited from interface jakarta.xml.soap.SOAPElement
addAttribute, addAttribute, addChildElement, 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
-
Method Details
-
addFault
Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject. The newSOAPFaultwill have default values set for the mandatory child elements. The type of theSOAPFaultwill be a SOAP 1.1 or a SOAP 1.2SOAPFaultdepending on theprotocolspecified while creating theMessageFactoryinstance.A
SOAPBodymay contain at most oneSOAPFaultchild element.- Returns:
- the new
SOAPFaultobject - Throws:
SOAPException- if there is a SOAP error
-
addFault
Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject. The type of theSOAPFaultwill be a SOAP 1.1 or a SOAP 1.2SOAPFaultdepending on theprotocolspecified while creating theMessageFactoryinstance.For SOAP 1.2 the
faultCodeparameter is the value of the Fault/Code/Value element and thefaultStringparameter is the value of the Fault/Reason/Text element. For SOAP 1.1 thefaultCodeparameter is the value of thefaultcodeelement and thefaultStringparameter is the value of thefaultstringelement.A
SOAPBodymay contain at most oneSOAPFaultchild element.- Parameters:
faultCode- aNameobject giving the fault code to be set; must be one of the fault codes defined in the Version of SOAP specification in usefaultString- aStringgiving an explanation of the faultlocale- aLocaleobject indicating the native language of thefaultString- Returns:
- the new
SOAPFaultobject - Throws:
SOAPException- if there is a SOAP error- Since:
- 1.6, SAAJ 1.2
- See Also:
-
addFault
Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject. The type of theSOAPFaultwill be a SOAP 1.1 or a SOAP 1.2SOAPFaultdepending on theprotocolspecified while creating theMessageFactoryinstance.For SOAP 1.2 the
faultCodeparameter is the value of the Fault/Code/Value element and thefaultStringparameter is the value of the Fault/Reason/Text element. For SOAP 1.1 thefaultCodeparameter is the value of thefaultcodeelement and thefaultStringparameter is the value of thefaultstringelement.A
SOAPBodymay contain at most oneSOAPFaultchild element.- Parameters:
faultCode- aQNameobject giving the fault code to be set; must be one of the fault codes defined in the version of SOAP specification in use.faultString- aStringgiving an explanation of the faultlocale- aLocaleobject indicating the native language of thefaultString- Returns:
- the new
SOAPFaultobject - Throws:
SOAPException- if there is a SOAP error- Since:
- 1.6, SAAJ 1.3
- See Also:
-
addFault
Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject. The type of theSOAPFaultwill be a SOAP 1.1 or a SOAP 1.2SOAPFaultdepending on theprotocolspecified while creating theMessageFactoryinstance.For SOAP 1.2 the
faultCodeparameter is the value of the Fault/Code/Value element and thefaultStringparameter is the value of the Fault/Reason/Text element. For SOAP 1.1 thefaultCodeparameter is the value of the faultcode element and thefaultStringparameter is the value of the faultstring element.In case of a SOAP 1.2 fault, the default value for the mandatory
xml:langattribute on the Fault/Reason/Text element will be set tojava.util.Locale.getDefault()A
SOAPBodymay contain at most oneSOAPFaultchild element.- Parameters:
faultCode- aNameobject giving the fault code to be set; must be one of the fault codes defined in the version of SOAP specification in usefaultString- aStringgiving an explanation of the fault- Returns:
- the new
SOAPFaultobject - Throws:
SOAPException- if there is a SOAP error- Since:
- 1.6, SAAJ 1.2
- See Also:
-
addFault
Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject. The type of theSOAPFaultwill be a SOAP 1.1 or a SOAP 1.2SOAPFaultdepending on theprotocolspecified while creating theMessageFactoryinstance.For SOAP 1.2 the
faultCodeparameter is the value of the Fault/Code/Value element and thefaultStringparameter is the value of the Fault/Reason/Text element. For SOAP 1.1 thefaultCodeparameter is the value of the faultcode element and thefaultStringparameter is the value of the faultstring element.In case of a SOAP 1.2 fault, the default value for the mandatory
xml:langattribute on the Fault/Reason/Text element will be set tojava.util.Locale.getDefault()A
SOAPBodymay contain at most oneSOAPFaultchild element- Parameters:
faultCode- aQNameobject giving the fault code to be set; must be one of the fault codes defined in the version of SOAP specification in usefaultString- aStringgiving an explanation of the fault- Returns:
- the new
SOAPFaultobject - Throws:
SOAPException- if there is a SOAP error- Since:
- 1.6, SAAJ 1.3
- See Also:
-
hasFault
boolean hasFault()Indicates whether aSOAPFaultobject exists in thisSOAPBodyobject.- Returns:
trueif aSOAPFaultobject exists in thisSOAPBodyobject;falseotherwise
-
getFault
SOAPFault getFault()Returns theSOAPFaultobject in thisSOAPBodyobject.- Returns:
- the
SOAPFaultobject in thisSOAPBodyobject if present, null otherwise.
-
addBodyElement
Creates a newSOAPBodyElementobject with the specified name and adds it to thisSOAPBodyobject.- Parameters:
name- aNameobject with the name for the newSOAPBodyElementobject- Returns:
- the new
SOAPBodyElementobject - Throws:
SOAPException- if a SOAP error occurs- See Also:
-
addBodyElement
Creates a newSOAPBodyElementobject with the specified QName and adds it to thisSOAPBodyobject.- Parameters:
qname- aQNameobject with the qname for the newSOAPBodyElementobject- Returns:
- the new
SOAPBodyElementobject - Throws:
SOAPException- if a SOAP error occurs- Since:
- 1.6, SAAJ 1.3
- See Also:
-
addDocument
Adds the root node of the DOMDocumentto thisSOAPBodyobject.Calling this method invalidates the
documentparameter. The client application should discard all references to thisDocumentand its contents upon callingaddDocument. The behavior of an application that continues to use such references is undefined.- Parameters:
document- theDocumentobject whose root node will be added to thisSOAPBody.- Returns:
- the
SOAPBodyElementthat represents the root node that was added. - Throws:
SOAPException- if theDocumentcannot be added- Since:
- 1.6, SAAJ 1.2
-
extractContentAsDocument
Creates a new DOMDocumentand sets the first child of thisSOAPBodyas it's document element. The childSOAPElementis removed as part of the process.- Returns:
- the
Documentrepresentation of theSOAPBodycontent. - Throws:
SOAPException- if there is not exactly one childSOAPElementof theSOAPBody.- Since:
- 1.6, SAAJ 1.3
-