-
- 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
SOAPBodyobject containsSOAPBodyElementobjects, which have the content for the SOAP body. ASOAPFaultobject, which carries status and/or error information, is an example of aSOAPBodyElementobject.- 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
Methods Modifier and Type Method and Description SOAPBodyElementaddBodyElement(Name name)Creates a newSOAPBodyElementobject with the specified name and adds it to thisSOAPBodyobject.SOAPBodyElementaddBodyElement(QName qname)Creates a newSOAPBodyElementobject with the specified QName and adds it to thisSOAPBodyobject.SOAPBodyElementaddDocument(Document document)Adds the root node of the DOMto thisDocumentSOAPBodyobject.SOAPFaultaddFault()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.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.DocumentextractContentAsDocument()Creates a new DOMand sets the first child of thisDocumentSOAPBodyas it's document element.SOAPFaultgetFault()Returns theSOAPFaultobject in thisSOAPBodyobject.booleanhasFault()Indicates whether aSOAPFaultobject exists in thisSOAPBodyobject.-
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
-
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
-
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 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
-
-
-
-
Method Detail
-
addFault
SOAPFault addFault() throws SOAPException
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) throws SOAPException
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:
- 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) throws SOAPException
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:
- 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) throws SOAPException
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:
- SAAJ 1.2
- See Also:
SOAPFault.setFaultCode(javax.xml.soap.Name),SOAPFault.setFaultString(java.lang.String)
-
addFault
SOAPFault addFault(QName faultCode, String faultString) throws SOAPException
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:
- 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) throws SOAPException
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) throws SOAPException
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:
- SAAJ 1.3
- See Also:
addBodyElement(Name)
-
addDocument
SOAPBodyElement addDocument(Document document) throws SOAPException
Adds the root node of the DOMto thisDocumentSOAPBodyobject.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:
- SAAJ 1.2
-
extractContentAsDocument
Document extractContentAsDocument() throws SOAPException
Creates a new DOMand sets the first child of thisDocumentSOAPBodyas it's document element. The childSOAPElementis removed as part of the process.- Returns:
- the
representation of theDocumentSOAPBodycontent. - Throws:
SOAPException- if there is not exactly one childSOAPElementof theSOAPBody.- Since:
- SAAJ 1.3
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
04/10/2025 21:44:11 Cette version de la page est en cache (à la date du 04/10/2025 21:44:11) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 11/06/2005, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/xml/soap/SOAPBody.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.