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.
setFaultActor(String faultActor) Sets this SOAPFault object with the given fault actor.
abstractpublic void
setFaultCode(String faultCode) Sets this SOAPFault object with the given fault code.
abstractpublic void
setFaultCode(Name name) 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.
setFaultString(String faultString) Sets the fault string for this SOAPFault object to the given string.
abstractpublic void
setFaultString(String faultString, Locale locale) Sets the fault string for this SOAPFault object to the given string and
localized to the given locale.
Creates a 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.
the new Detail object throws: SOAPException - if this SOAPFault object already contains a validDetail object
Gets the fault actor for this SOAPFault object.
a String giving the actor in the message path that caused thisSOAPFault object See Also:SOAPFault.setFaultActor(String) See Also: setFaultActor(java.lang.String)
Gets the fault code for this SOAPFault object.
a String with the fault code See Also:SOAPFault.setFaultCode(String) See Also: setFaultCode(java.lang.String)
Gets the mandatory SOAP 1.1 fault code for this 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.
a Name representing the faultcode
Returns the optional detail element for this SOAPFault object.
a Locale object indicating the native language of the fault string ornull if no locale was specified
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.
Parameters: faultActor - a String identifying the actor that caused this SOAPFault object throws: SOAPException - if there was an error in adding the faultActor to theunderlying XML tree. See Also:SOAPFault.getFaultActor() See Also: getFaultActor()
Sets this SOAPFault object with the given fault code.
Fault codes, which given information about the fault, are defined in the SOAP 1.1
specification.
Parameters: faultCode - a String giving the fault code to be set; must be one of thefault codes defined in the SOAP 1.1 specification throws: SOAPException - if there was an error in adding the faultCode to theunderlying XML tree. See Also:SOAPFault.getFaultCode() See Also: getFaultCode()
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).
Parameters: name - a Name object giving the fault code to be set. It must be namespacequalified. throws: SOAPException - if there was an error in adding the faultcode element tothe underlying XML tree
Sets the fault string for this SOAPFault object to the given string.
Parameters: faultString - a String giving an explanation of the fault throws: SOAPException - if there was an error in adding the faultString to theunderlying XML tree. See Also:SOAPFault.getFaultString() See Also: getFaultString()
Sets the fault string for this SOAPFault object to the given string and
localized to the given locale.
Parameters: faultString - a String giving an explanation of the fault Parameters: locale - a Locale object indicating the native language of thefaultString throws: SOAPException - if there was an error in adding the faultString to theunderlying XML tree