|
J2EE1.4 SDK | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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.
The SOAPFault interface provides methods for
retrieving the information contained in a SOAPFault object
and for setting the fault code, the fault actor, and a string describing
the fault. A fault code is one of the codes defined in the SOAP 1.1
specification that describe the fault. An actor is
an intermediate recipient to whom a message was routed. The message
path may include one or more actors, or, if no actors are specified,
the message goes only to the default actor, which is the final intended
recipient.
| Field Summary |
| Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, 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.
|
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.
|
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. |
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(java.lang.String faultCode)
Sets this SOAPFault object with the give fault code.
|
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.Node |
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
| Methods inherited from interface org.w3c.dom.Element |
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS |
| Method Detail |
public 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 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).
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()
public 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(java.lang.String, java.lang.String)public 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.
In the future, a QName object version of this method may also be added.
Name representing the faultcodesetFaultCode(Name)public java.lang.String getFaultCode()
SOAPFault object.
String with the fault codegetFaultCodeAsName(),
setFaultCode(javax.xml.soap.Name)
public 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.
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()public java.lang.String getFaultActor()
SOAPFault object.
String giving the actor in the message path
that caused this SOAPFault objectsetFaultActor(java.lang.String)
public void setFaultString(java.lang.String faultString)
throws SOAPException
SOAPFault object
to the given string.
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()
public void setFaultString(java.lang.String faultString,
java.util.Locale locale)
throws SOAPException
SOAPFault object
to the given string and localized to the given 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()public java.lang.String getFaultString()
SOAPFault object.
String giving an explanation of
the faultsetFaultString(String),
setFaultString(String, Locale)public java.util.Locale getFaultStringLocale()
SOAPFault
object.
Locale object indicating the native language of
the fault string or null if no locale was specifiedsetFaultString(String, Locale)public Detail getDetail()
SOAPFault
object.
A Detail object carries application-specific error
information related to SOAPBodyElement objects.
Detail object with application-specific
error information
public Detail 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 object
SOAPException
|
J2EE1.4 SDK | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright 2003 Sun Microsystems, Inc. All rights reserved.