|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SOAPFault
An element in the SOAPBody
object that contains
error and/or status information. This information may relate to
errors in the SOAPMessage
object or to problems
that are not related to the content in the message itself. Problems
not related to the message itself are generally errors in
processing, such as the inability to communicate with an upstream
server.
Depending on the protocol
specified while creating the
MessageFactory
instance, a SOAPFault
has
sub-elements as defined in the SOAP 1.1/SOAP 1.2 specification.
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 | |
---|---|
Detail |
addDetail()
Creates an optional Detail object and sets it as the
Detail object for this SOAPFault
object. |
void |
addFaultReasonText(java.lang.String text,
java.util.Locale locale)
Appends or replaces a Reason Text item containing the specified text message and an xml:lang derived from locale . |
void |
appendFaultSubcode(javax.xml.namespace.QName subcode)
Adds a Subcode to the end of the sequence of Subcodes contained by this SOAPFault . |
Detail |
getDetail()
Returns the optional detail element for this SOAPFault
object. |
java.lang.String |
getFaultActor()
Gets the fault actor for this SOAPFault object. |
java.lang.String |
getFaultCode()
Gets the fault code for this SOAPFault object. |
Name |
getFaultCodeAsName()
Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name object. |
javax.xml.namespace.QName |
getFaultCodeAsQName()
Gets the fault code for this SOAPFault object as a QName object. |
java.lang.String |
getFaultNode()
Returns the optional Node element value for this SOAPFault object. |
java.util.Iterator |
getFaultReasonLocales()
Returns an Iterator over a distinct sequence of
Locale s for which there are associated Reason Text items. |
java.lang.String |
getFaultReasonText(java.util.Locale locale)
Returns the Reason Text associated with the given Locale . |
java.util.Iterator |
getFaultReasonTexts()
Returns an Iterator over a sequence of
String objects containing all of the Reason Text items for
this SOAPFault . |
java.lang.String |
getFaultRole()
Returns the optional Role element value for this SOAPFault object. |
java.lang.String |
getFaultString()
Gets the fault string for this SOAPFault object. |
java.util.Locale |
getFaultStringLocale()
Gets the locale of the fault string for this SOAPFault
object. |
java.util.Iterator |
getFaultSubcodes()
Gets the Subcodes for this SOAPFault as an iterator over
QNames . |
boolean |
hasDetail()
Returns true if this SOAPFault has a Detail
subelement and false otherwise. |
void |
removeAllFaultSubcodes()
Removes any Subcodes that may be contained by this SOAPFault . |
void |
setFaultActor(java.lang.String faultActor)
Sets this SOAPFault object with the given fault actor. |
void |
setFaultCode(Name faultCodeQName)
Sets this SOAPFault object with the given fault code. |
void |
setFaultCode(javax.xml.namespace.QName faultCodeQName)
Sets this SOAPFault object with the given fault code. |
void |
setFaultCode(java.lang.String faultCode)
Sets this SOAPFault object with the give fault code. |
void |
setFaultNode(java.lang.String uri)
Creates or replaces any existing Node element value for this SOAPFault object. |
void |
setFaultRole(java.lang.String uri)
Creates or replaces any existing Role element value for this SOAPFault object. |
void |
setFaultString(java.lang.String faultString)
Sets the fault string for this SOAPFault object
to the given string. |
void |
setFaultString(java.lang.String faultString,
java.util.Locale locale)
Sets the fault string for this SOAPFault object
to the given string and localized to the given locale. |
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 |
---|
void setFaultCode(Name faultCodeQName) throws SOAPException
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 Name
. 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)
.
faultCodeQName
- a Name
object giving the fault
code to be set. It must be namespace qualified.
SOAPException
- if there was an error in adding the
faultcode element to the underlying XML tree.getFaultCodeAsName()
void setFaultCode(javax.xml.namespace.QName faultCodeQName) throws SOAPException
SOAPFault
object with the given fault code.
It is preferable to use this method over setFaultCode(Name)
.
faultCodeQName
- a QName
object giving the fault
code to be set. It must be namespace qualified.
SOAPException
- if there was an error in adding the
faultcode
element to the underlying XML tree.getFaultCodeAsQName()
,
setFaultCode(Name)
,
getFaultCodeAsQName()
void setFaultCode(java.lang.String faultCode) throws SOAPException
SOAPFault
object with the give 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.
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.
SOAPException
- if there was an error in adding the
faultCode
to the underlying XML tree.setFaultCode(Name)
,
getFaultCode()
,
SOAPElement#addNamespaceDeclaration
Name getFaultCodeAsName()
SOAPFault
object as a SAAJ Name
object.
The SOAP 1.1 specification requires the value of the "faultcode"
element to be of type QName. This method returns the content of the
element as a QName in the form of a SAAJ Name object. This method
should be used instead of the getFaultCode
method since
it allows applications to easily access the namespace name without
additional parsing.
Name
representing the faultcodesetFaultCode(Name)
javax.xml.namespace.QName getFaultCodeAsQName()
SOAPFault
object as a QName
object.
QName
representing the faultcodesetFaultCode(QName)
java.util.Iterator getFaultSubcodes()
SOAPFault
as an iterator over
QNames
.
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.
java.lang.UnsupportedOperationException
- if this message does not
support the SOAP 1.2 concept of Subcode.void removeAllFaultSubcodes()
SOAPFault
. Subsequent calls to
getFaultSubcodes
will return an empty iterator until a call
to appendFaultSubcode
is made.
java.lang.UnsupportedOperationException
- if this message does not
support the SOAP 1.2 concept of Subcode.void appendFaultSubcode(javax.xml.namespace.QName subcode) throws SOAPException
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.
subcode
- a QName containing the Value of the Subcode.
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.java.lang.String getFaultCode()
SOAPFault
object.
String
with the fault codegetFaultCodeAsName()
,
setFaultCode(javax.xml.soap.Name)
void setFaultActor(java.lang.String faultActor) throws SOAPException
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)
faultActor
- a String
identifying the actor that
caused this SOAPFault
object
SOAPException
- if there was an error in adding the
faultActor
to the underlying XML tree.getFaultActor()
java.lang.String getFaultActor()
SOAPFault
object.
If this SOAPFault
supports SOAP 1.2 then this call is
equivalent to getFaultRole()
String
giving the actor in the message path
that caused this SOAPFault
objectsetFaultActor(java.lang.String)
void setFaultString(java.lang.String faultString) throws SOAPException
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());
faultString
- a String
giving an explanation of
the fault
SOAPException
- if there was an error in adding the
faultString
to the underlying XML tree.getFaultString()
void setFaultString(java.lang.String faultString, java.util.Locale locale) throws SOAPException
SOAPFault
object
to the given string and localized to the given locale.
If this
SOAPFault
is part of a message that supports SOAP 1.2 then
this call is equivalent to:
addFaultReasonText(faultString, locale);
faultString
- a String
giving an explanation of
the faultlocale
- a Locale
object indicating
the native language of the faultString
SOAPException
- if there was an error in adding the
faultString
to the underlying XML tree.getFaultString()
java.lang.String getFaultString()
SOAPFault
object.
If this
SOAPFault
is part of a message that supports SOAP 1.2 then
this call is equivalent to:
String reason = null; try { reason = (String) getFaultReasonTexts().next(); } catch (SOAPException e) {} return reason;
String
giving an explanation of
the faultsetFaultString(String)
,
setFaultString(String, Locale)
java.util.Locale getFaultStringLocale()
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;
Locale
object indicating the native language of
the fault string or null
if no locale was specifiedsetFaultString(String, Locale)
boolean hasDetail()
SOAPFault
has a Detail
subelement and false otherwise. Equivalent to
(getDetail()!=null)
.
SOAPFault
has a Detail
subelement and false otherwise.Detail getDetail()
SOAPFault
object.
A Detail
object carries application-specific error
information, the scope of the error information is restricted to
faults in the SOAPBodyElement
objects if this is a
SOAP 1.1 Fault.
Detail
object with application-specific
error information if present, null otherwiseDetail addDetail() throws SOAPException
Detail
object and sets it as the
Detail
object for this SOAPFault
object.
It is illegal to add a detail when the fault already contains a detail. Therefore, this method should be called only after the existing detail has been removed.
Detail
object
SOAPException
- if this
SOAPFault
object already contains a
valid Detail
objectjava.util.Iterator getFaultReasonLocales() throws SOAPException
Iterator
over a distinct sequence of
Locale
s for which there are associated Reason Text items.
Any of these Locale
s can be used in a call to
getFaultReasonText
in order to obtain a localized version
of the Reason Text string.
Iterator
over a sequence of Locale
objects for which there are associated Reason Text items.
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.java.util.Iterator getFaultReasonTexts() throws SOAPException
Iterator
over a sequence of
String
objects containing all of the Reason Text items for
this SOAPFault
.
Iterator
over env:Fault/env:Reason/env:Text items.
SOAPException
- if there was an error in retrieving
the fault Reason texts.
java.lang.UnsupportedOperationException
- if this message does not
support the SOAP 1.2 concept of Fault Reason.java.lang.String getFaultReasonText(java.util.Locale locale) throws SOAPException
Locale
.
If more than one such Reason Text exists the first matching Text is
returned
locale
- -- the Locale
for which a localized
Reason Text is desired
locale
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.getFaultString()
void addFaultReasonText(java.lang.String text, java.util.Locale locale) throws SOAPException
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);
text
- -- reason message stringlocale
- -- Locale object representing the locale of the message
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.java.lang.String getFaultNode()
SOAPFault
object. The Node element is
optional in SOAP 1.2.
null
if none
java.lang.UnsupportedOperationException
- if this message does not
support the SOAP 1.2 concept of Fault Node.void setFaultNode(java.lang.String uri) throws SOAPException
SOAPFault
object. The Node element
is optional in SOAP 1.2.
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.java.lang.String getFaultRole()
SOAPFault
object. The Role element is
optional in SOAP 1.2.
null
if none
java.lang.UnsupportedOperationException
- if this message does not
support the SOAP 1.2 concept of Fault Role.void setFaultRole(java.lang.String uri) throws SOAPException
SOAPFault
object. The Role element
is optional in SOAP 1.2.
uri
- - the URI of the Role
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2009, 2010, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.
Generated on 4-June-2010 04:34