Package org.apache.axis2.saaj
Class SOAPFaultImpl
java.lang.Object
org.apache.axis2.saaj.ProxyNode<T,S>
org.apache.axis2.saaj.NodeImpl<Element,T>
org.apache.axis2.saaj.SOAPElementImpl<T>
org.apache.axis2.saaj.SOAPBodyElementImpl<org.apache.axiom.soap.SOAPFault>
org.apache.axis2.saaj.SOAPFaultImpl
- All Implemented Interfaces:
jakarta.xml.soap.Node,jakarta.xml.soap.SOAPBodyElement,jakarta.xml.soap.SOAPElement,jakarta.xml.soap.SOAPFault,Element,Node
public class SOAPFaultImpl
extends SOAPBodyElementImpl<org.apache.axiom.soap.SOAPFault>
implements jakarta.xml.soap.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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.xml.soap.DetailvoidaddFaultReasonText(String text, Locale locale) Appends or replaces a Reason Text item containing the specified text message and an xml:lang derived from locale.voidappendFaultSubcode(QName subcode) Adds a Subcode to the end of the sequence of Subcodes contained by this SOAPFault.Returns an iterator over all the immediate content of this element.getChildElements(jakarta.xml.soap.Name name) jakarta.xml.soap.DetailGets the fault code for thisSOAPFaultobject.jakarta.xml.soap.NameGets the fault code for this SOAPFault object as aQNameobject.Returns the optional Node element value for this SOAPFault object.Returns an Iterator over a distinct sequence of Locales for which there are associated Reason Text items.getFaultReasonText(Locale locale) Returns the Reason Text associated with the given Locale.Returns an Iterator over a sequence of String objects containing all of the Reason Text items for this SOAPFault.Returns the optional Role element value for this SOAPFault object.Gets the locale of the fault string for this SOAPFault object.Gets the Subcodes for this SOAPFault as an iterator over QNames.booleanReturns true if this SOAPFault has a Detail subelement and false otherwise.voidRemoves any Subcodes that may be contained by this SOAPFault.voidsetFaultActor(String faultActor) Sets this SOAPFault object with the given fault actor.The fault actor is the recipient in the message path who caused the fault to happen.voidsetFaultCode(jakarta.xml.soap.Name faultCodeName) Sets this SOAPFault object with the given fault code.Fault codes, which give information about the fault, are defined in the SOAP 1.1 specification.voidsetFaultCode(String faultCode) Sets thisSOAPFaultobject with the given fault code.voidsetFaultCode(QName qname) Sets this SOAPFault object with the given fault code.voidCreates or replaces any existing Node element value for this SOAPFault object.voidsetFaultRole(String uri) Creates or replaces any existing Role element value for this SOAPFault object.voidsetFaultString(String faultString) Sets the fault string for thisSOAPFaultobject to the given string.voidsetFaultString(String faultString, Locale locale) Sets the fault string for this SOAPFault object to the given string.Methods inherited from class org.apache.axis2.saaj.SOAPBodyElementImpl
addAttribute, addChildElement, createQName, getAllAttributesAsQNames, getAttributeValue, getChildElements, getElementQName, removeAttribute, setElementQName, setParentElementMethods inherited from class org.apache.axis2.saaj.SOAPElementImpl
addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, clone, copyContents, getAllAttributes, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributeValue, getElementName, getElementsByTagName, getElementsByTagNameNS, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getTagName, getValue, getVisibleNamespacePrefixes, hasAttribute, hasAttributeNS, removeAttribute, removeAttribute, removeAttributeNode, removeAttributeNS, removeContents, removeNamespaceDeclaration, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setEncodingStyle, setValue, toStringMethods inherited from class org.apache.axis2.saaj.NodeImpl
detachNode, getParentElementMethods inherited from class org.apache.axis2.saaj.ProxyNode
appendChild, appendElement, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOMTarget, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSchemaTypeInfo, getTarget, getTextContent, getType, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, recycleNode, removeChild, replaceChild, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeValue, setPrefix, setTextContent, setType, setUserData, toSAAJNodeListMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration, setElementQName, setEncodingStyle
-
Constructor Details
-
SOAPFaultImpl
public SOAPFaultImpl(org.apache.axiom.soap.SOAPFault fault) - Parameters:
fault-
-
-
Method Details
-
setFaultCode
Sets thisSOAPFaultobject with the given fault code. Fault codes, which given information about the fault, are defined in the SOAP 1.1 specification. This element is mandatory in SOAP 1.1. Because the fault code is required to be a QName it is preferable to use the setFaultCode(Name)form of this method.- Specified by:
setFaultCodein interfacejakarta.xml.soap.SOAPFault- Parameters:
faultCode- - a String giving the fault code to be set. It must be of the form "prefix:localName" where the prefix has been defined in a namespace declaration.- Throws:
jakarta.xml.soap.SOAPException- - if there was an error in adding the faultCode to the underlying XML tree.
-
getFaultCode
Gets the fault code for thisSOAPFaultobject.- Specified by:
getFaultCodein interfacejakarta.xml.soap.SOAPFault- Returns:
- a
Stringwith the fault code - See Also:
-
setFaultActor
Sets this SOAPFault object with the given fault actor.The fault actor is the recipient in the message path who caused the fault to happen. If this SOAPFault supports SOAP 1.2 then this call is equivalent to setFaultRole(String)- Specified by:
setFaultActorin interfacejakarta.xml.soap.SOAPFault- Parameters:
faultActor- - a String identifying the actor that caused this SOAPFault object- Throws:
jakarta.xml.soap.SOAPException- - if there was an error in adding the faultActor to the underlying XML tree.
-
getFaultActor
- Specified by:
getFaultActorin interfacejakarta.xml.soap.SOAPFault
-
setFaultString
Sets the fault string for thisSOAPFaultobject to the given string.- Specified by:
setFaultStringin interfacejakarta.xml.soap.SOAPFault- Parameters:
faultString- aStringgiving an explanation of the fault- Throws:
jakarta.xml.soap.SOAPException- if there was an error in adding thefaultStringto the underlying XML tree.- See Also:
-
getFaultString
- Specified by:
getFaultStringin interfacejakarta.xml.soap.SOAPFault
-
getDetail
public jakarta.xml.soap.Detail getDetail()- Specified by:
getDetailin interfacejakarta.xml.soap.SOAPFault
-
setFaultCode
public void setFaultCode(jakarta.xml.soap.Name faultCodeName) throws jakarta.xml.soap.SOAPException Sets this SOAPFault object with the given fault code.Fault codes, which give information about the fault, are defined in the SOAP 1.1 specification. A fault code is mandatory and must be of type QName. This method provides a convenient way to set a fault code. For example, SOAPEnvelope se = ...; // Create a qualified name in the SOAP namespace with a localName // of Client. Note that prefix parameter is optional and is null // here which causes the implementation to use an appropriate prefix. Name qname = se.createName(Client, null,SOAPConstants.URI_NS_SOAP_ENVELOPE); SOAPFault fault = ...; fault.setFaultCode(qname); It is preferable to use this method over setFaultCode(String).- Specified by:
setFaultCodein interfacejakarta.xml.soap.SOAPFault- Parameters:
faultCodeQName- - a Name object giving the fault code to be set. It must be namespace qualified.- Throws:
jakarta.xml.soap.SOAPException- - if there was an error in adding the faultcode element to the underlying XML tree.
-
addDetail
public jakarta.xml.soap.Detail addDetail() throws jakarta.xml.soap.SOAPException- Specified by:
addDetailin interfacejakarta.xml.soap.SOAPFault- Throws:
jakarta.xml.soap.SOAPException
-
getFaultCodeAsName
public jakarta.xml.soap.Name getFaultCodeAsName()- Specified by:
getFaultCodeAsNamein interfacejakarta.xml.soap.SOAPFault
-
setFaultString
Sets the fault string for this SOAPFault object to the given string. If this SOAPFault is part of a message that supports SOAP 1.2 then this call is equivalent to: addFaultReasonText(faultString, Locale.getDefault());- Specified by:
setFaultStringin interfacejakarta.xml.soap.SOAPFault- Parameters:
faultString- - a String giving an explanation of the fault- Throws:
jakarta.xml.soap.SOAPException- - if there was an error in adding the faultString to the underlying XML tree.- See Also:
-
getFaultStringLocale
Gets the locale of the fault string for this SOAPFault object. If this SOAPFault is part of a message that supports SOAP 1.2 then this call is equivalent to: Locale locale = null; try { locale = (Locale) getFaultReasonLocales().next(); } catch (SOAPException e) {} return locale;- Specified by:
getFaultStringLocalein interfacejakarta.xml.soap.SOAPFault- Returns:
- a Locale object indicating the native language of the fault string or null if no locale was specified
- Since:
- SAAJ 1.2
- See Also:
-
addFaultReasonText
Appends or replaces a Reason Text item containing the specified text message and an xml:lang derived from locale. If a Reason Text item with this xml:lang already exists its text value will be replaced with text. The locale parameter should not be null Code sample: SOAPFault fault = ...; fault.addFaultReasonText(Version Mismatch, Locale.ENGLISH);- Specified by:
addFaultReasonTextin interfacejakarta.xml.soap.SOAPFault- Parameters:
text- - reason message string locale - Locale object representing the locale of the message- Throws:
jakarta.xml.soap.SOAPException- - if there was an error in adding the Reason text or the locale passed was null. java.lang.UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Reason.
-
appendFaultSubcode
Adds a Subcode to the end of the sequence of Subcodes contained by this SOAPFault. Subcodes, which were introduced in SOAP 1.2, are represented by a recursive sequence of subelements rooted in the mandatory Code subelement of a SOAP Fault.- Specified by:
appendFaultSubcodein interfacejakarta.xml.soap.SOAPFault- Parameters:
subcode- - a QName containing the Value of the Subcode.- Throws:
jakarta.xml.soap.SOAPException- - if there was an error in setting the Subcode java.lang.UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Subcode.
-
getFaultCodeAsQName
Gets the fault code for this SOAPFault object as aQNameobject.- Specified by:
getFaultCodeAsQNamein interfacejakarta.xml.soap.SOAPFault
-
getFaultNode
Returns the optional Node element value for this SOAPFault object. The Node element is optional in SOAP 1.2.- Specified by:
getFaultNodein interfacejakarta.xml.soap.SOAPFault- Returns:
- Content of the env:Fault/env:Node element as a String or null if none
- Throws:
UnsupportedOperationException- - if this message does not support the SOAP 1.2 concept of Fault Node.
-
getFaultReasonLocales
Returns an Iterator over a distinct sequence of Locales for which there are associated Reason Text items. Any of these Locales can be used in a call to getFaultReasonText in order to obtain a localized version of the Reason Text string.- Specified by:
getFaultReasonLocalesin interfacejakarta.xml.soap.SOAPFault- Returns:
- an Iterator over a sequence of Locale objects for which there are associated Reason Text items.
- Throws:
jakarta.xml.soap.SOAPException- - if there was an error in retrieving the fault Reason locales. java.lang.UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Reason.- Since:
- SAAJ 1.3
-
getFaultReasonText
Returns the Reason Text associated with the given Locale. If more than one such Reason Text exists the first matching Text is returned- Specified by:
getFaultReasonTextin interfacejakarta.xml.soap.SOAPFault- Parameters:
locale- - the Locale for which a localized Reason Text is desired- Returns:
- the Reason Text associated with locale
- Throws:
jakarta.xml.soap.SOAPException- - if there was an error in retrieving the fault Reason text for the specified locale. java.lang.UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Reason.- Since:
- SAAJ 1.3
-
getFaultReasonTexts
Returns an Iterator over a sequence of String objects containing all of the Reason Text items for this SOAPFault.- Specified by:
getFaultReasonTextsin interfacejakarta.xml.soap.SOAPFault- Throws:
jakarta.xml.soap.SOAPException- if there is an error in retrieving texts for Reason objects java.lang.UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Reason.
-
getFaultRole
Returns the optional Role element value for this SOAPFault object. The Role element is optional in SOAP 1.2.- Specified by:
getFaultRolein interfacejakarta.xml.soap.SOAPFault- Returns:
- Content of the env:Fault/env:Role element as a String or null if none
- Throws:
UnsupportedOperationException- - if this message does not support the SOAP 1.2 concept of Fault Role.- Since:
- SAAJ 1.3
-
getFaultSubcodes
Gets the Subcodes for this SOAPFault as an iterator over QNames.- Specified by:
getFaultSubcodesin interfacejakarta.xml.soap.SOAPFault- Returns:
- an Iterator that accesses a sequence of QNames. This Iterator should not support the optional remove method. The order in which the Subcodes are returned reflects the hierarchy of Subcodes present in the fault from top to bottom.
- Throws:
UnsupportedOperationException- - if this message does not support the SOAP 1.2 concept of Subcode.
-
hasDetail
public boolean hasDetail()Returns true if this SOAPFault has a Detail subelement and false otherwise.- Specified by:
hasDetailin interfacejakarta.xml.soap.SOAPFault
-
removeAllFaultSubcodes
public void removeAllFaultSubcodes()Removes any Subcodes that may be contained by this SOAPFault. Subsequent calls to getFaultSubcodes will return an empty iterator until a call to appendFaultSubcode is made.- Specified by:
removeAllFaultSubcodesin interfacejakarta.xml.soap.SOAPFault- Throws:
UnsupportedOperationException- - if this message does not support the SOAP 1.2 concept of Subcode.
-
setFaultCode
Sets this SOAPFault object with the given fault code. It is preferable to use this method over setFaultCode(Name)- Specified by:
setFaultCodein interfacejakarta.xml.soap.SOAPFault- Parameters:
faultCodeQName- - a QName object giving the fault code to be set. It must be namespace qualified.- Throws:
jakarta.xml.soap.SOAPException- - if there was an error in adding the faultcode element to the underlying XML tree.- Since:
- SAAJ 1.3
-
setFaultNode
Creates or replaces any existing Node element value for this SOAPFault object. The Node element is optional in SOAP 1.2.- Specified by:
setFaultNodein interfacejakarta.xml.soap.SOAPFault- Throws:
jakarta.xml.soap.SOAPException- - if there was an error in setting the Node for this SOAPFault object. java.lang.UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Node.- Since:
- SAAJ 1.3
-
setFaultRole
Creates or replaces any existing Role element value for this SOAPFault object. The Role element is optional in SOAP 1.2.- Specified by:
setFaultRolein interfacejakarta.xml.soap.SOAPFault- Parameters:
uri- - the URI of the Role- Throws:
jakarta.xml.soap.SOAPException- - if there was an error in setting the Role for this SOAPFault object java.lang.UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Role.
-
getChildElements
- Specified by:
getChildElementsin interfacejakarta.xml.soap.SOAPElement- Overrides:
getChildElementsin classSOAPElementImpl<org.apache.axiom.soap.SOAPFault>
-
getChildElements
Description copied from class:SOAPElementImplReturns an iterator over all the immediate content of this element. This includesTextobjects as well asSOAPElementobjects.- Specified by:
getChildElementsin interfacejakarta.xml.soap.SOAPElement- Overrides:
getChildElementsin classSOAPElementImpl<org.apache.axiom.soap.SOAPFault>- Returns:
- an iterator over
TextandSOAPElementcontained within thisSOAPElementobject
-