- All Superinterfaces:
Element,Node,Node,SOAPElement
public interfaceSOAPBodyextendsSOAPElement
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
SOAPBodyobject containsSOAPBodyElementobjects, which have the content for the SOAP body. ASOAPFaultobject, which carries status and/or error information, is an example of aSOAPBodyElementobject.- Since:
- 1.6
- See Also:
SOAPFault
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SOAPBodyElementaddBodyElement(QName qname)Creates a newSOAPBodyElementobject with the specified QName and adds it to thisSOAPBodyobject.SOAPBodyElementaddBodyElement(Name name)Creates a newSOAPBodyElementobject with the specified name and adds it to thisSOAPBodyobject.SOAPBodyElementaddDocument(Document document)Adds the root node of the DOMDocumentto thisSOAPBodyobject.SOAPFaultaddFault()Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.SOAPFaultaddFault(QName faultCode,String faultString)Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.SOAPFaultaddFault(QName faultCode,String faultString,Locale locale)Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.SOAPFaultaddFault(Name faultCode,String faultString)Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.SOAPFaultaddFault(Name faultCode,String faultString,Locale locale)Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.DocumentextractContentAsDocument()Creates a new DOMDocumentand sets the first child of thisSOAPBodyas it's document element.SOAPFaultgetFault()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,setIdAttributeNS
Methods inherited from interface javax.xml.soap.Node
detachNode,getParentElement,getValue,recycleNode,setParentElement,setValue
Methods 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,setUserData
Methods inherited from interface javax.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 Detail
addFault
SOAPFault addFault() throwsSOAPException
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
SOAPFault addFault(Name faultCode,String faultString,Locale locale) throwsSOAPException
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 theFault/Code/Value element and thefaultStringparameter is the value of theFault/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:
SOAPFault.setFaultCode(javax.xml.soap.Name),SOAPFault.setFaultString(java.lang.String)
addFault
SOAPFault addFault(QName faultCode,String faultString,Locale locale) throwsSOAPException
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 theFault/Code/Value element and thefaultStringparameter is the value of theFault/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:
SOAPFault.setFaultCode(javax.xml.soap.Name),SOAPFault.setFaultString(java.lang.String),addFault(Name faultCode, String faultString, Locale locale)
addFault
SOAPFault addFault(Name faultCode,String faultString) throwsSOAPException
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 theFault/Code/Value element and thefaultStringparameter is the value of theFault/Reason/Text element. For SOAP 1.1 thefaultCodeparameter is the value of thefaultcode element and thefaultStringparameter is the value of thefaultstring element.In case of a SOAP 1.2 fault, the default value for the mandatory
xml:langattribute on theFault/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:
SOAPFault.setFaultCode(javax.xml.soap.Name),SOAPFault.setFaultString(java.lang.String)
addFault
SOAPFault addFault(QName faultCode,String faultString) throwsSOAPException
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 theFault/Code/Value element and thefaultStringparameter is the value of theFault/Reason/Text element. For SOAP 1.1 thefaultCodeparameter is the value of thefaultcode element and thefaultStringparameter is the value of thefaultstring element.In case of a SOAP 1.2 fault, the default value for the mandatory
xml:langattribute on theFault/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:
SOAPFault.setFaultCode(javax.xml.soap.Name),SOAPFault.setFaultString(java.lang.String),addFault(Name faultCode, String faultString)
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
SOAPBodyElement addBodyElement(Name name) throwsSOAPException
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(javax.xml.namespace.QName)
addBodyElement
SOAPBodyElement addBodyElement(QName qname) throwsSOAPException
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:
addBodyElement(Name)
addDocument
SOAPBodyElement addDocument(Document document) throwsSOAPException
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
Document extractContentAsDocument() throwsSOAPException
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