org.apache.axis
public class AxisFault extends RemoteException
Field Summary | |
---|---|
protected String | faultActor |
protected QName | faultCode |
protected Vector | faultDetails |
protected ArrayList | faultHeaders SOAP headers which should be serialized with the Fault. |
protected String | faultNode |
protected String | faultString |
protected Vector | faultSubCode SOAP1.2 addition: subcodes of faults; a Vector of QNames |
protected static Log | log
The Log used by this class for all logging. |
Constructor Summary | |
---|---|
AxisFault(String code, String faultString, String actor, Element[] details)
Make a fault in the Constants.NS_URI_AXIS namespace.
| |
AxisFault(QName code, String faultString, String actor, Element[] details)
Make a fault in any namespace.
| |
AxisFault(QName code, QName[] subcodes, String faultString, String actor, String node, Element[] details)
Make a fault in any namespace.
| |
protected | AxisFault(Exception target)
Wrap an AxisFault around an existing Exception. |
AxisFault(String message)
create a simple axis fault from the message. | |
AxisFault()
No-arg constructor for building one from an XML stream. | |
AxisFault(String message, Throwable t)
create a fault from any throwable;
When faulting a throwable (as opposed to an exception),
stack trace information does not go into the fault. |
Method Summary | |
---|---|
void | addFaultDetail(Element detail)
Append an element to the fault detail list.
|
void | addFaultDetail(QName qname, String body)
Create an element of the given qname and add it to the details.
|
void | addFaultDetailString(String detail)
add a string tag to the fault details. |
void | addFaultSubCode(QName code)
Add a fault sub-code.
|
void | addFaultSubCodeAsString(String code)
Add a fault sub-code with the local name code and namespace
Constants.NS_URI_AXIS .
|
void | addHeader(SOAPHeaderElement header)
Add a SOAP header which should be serialized along with the
fault.
|
void | addHostname(String hostname)
add the hostname string. |
void | addHostnameIfNeeded()
add the hostname of the current system. |
void | clearFaultDetails()
Clear the fault details list. |
void | clearFaultSubCodes()
Clear all fault sub-codes.
|
void | clearHeaders()
Clear all fault headers. |
void | dump()
Dump the fault info to the log at debug level. |
String | dumpToString()
turn the fault and details into a string, with XML escaping.
subclassers: for security (cross-site-scripting) reasons,
escape everything that could contain caller-supplied data. |
String | getFaultActor()
get the fault actor |
QName | getFaultCode()
Get the fault code QName .
|
Element[] | getFaultDetails()
Get all the fault details.
|
String | getFaultNode()
Get the fault node.
|
String | getFaultReason()
This is SOAP 1.2 equivalent of getFaultString. |
String | getFaultRole()
This is SOAP 1.2 equivalent of getFaultActor. |
String | getFaultString()
Get the fault string; this will never be null but may be the
empty string.
|
QName[] | getFaultSubCodes()
get the fault subcode list; only used in SOAP 1.2 |
ArrayList | getHeaders()
Get the SOAP headers associated with this fault.
|
protected void | initFaultSubCodes()
Do whatever is needed to create the fault subcodes
data structure, if it is needed. |
Element | lookupFaultDetail(QName qname)
Find a fault detail element by its qname. |
static AxisFault | makeFault(Exception e)
Make an AxisFault based on a passed Exception. |
void | output(SerializationContext context)
Add this fault and any needed headers to the output context.
|
void | printStackTrace(PrintStream ps)
The override of the base class method prints out the
fault info before the stack trace.
|
void | printStackTrace(PrintWriter pw)
The override of the base class method prints out the
fault info before the stack trace.
|
boolean | removeFaultDetail(QName qname)
Find and remove a specified fault detail element.
|
void | removeHostname()
strip out the hostname on a message. |
void | setFaultActor(String actor)
Set the fault actor.
|
void | setFaultCode(QName code)
Set the fault code.
|
void | setFaultCode(String code)
Set the fault code (as a String).
|
void | setFaultCodeAsString(String code)
set a fault code string that is turned into a qname
in the SOAP 1.1 or 1.2 namespace, depending on the current context |
void | setFaultDetail(Element[] details)
Set the fault detail element to the arrary of details.
|
void | setFaultDetailString(String details)
set the fault details to a string element. |
void | setFaultNode(String node)
Set the fault node.
|
void | setFaultReason(String str)
This is SOAP 1.2 equivalent of AxisFault.
|
void | setFaultRole(String role)
This is SOAP 1.2 equivalent of AxisFault. |
void | setFaultString(String str)
Set a fault string. |
String | toString()
Stringify this fault as the current fault string.
|
void | writeDetails(QName qname, SerializationContext context)
Writes any exception data to the faultDetails.
|
Log
used by this class for all logging.Constants.NS_URI_AXIS
namespace.
Parameters: code fault code which will be passed into the Axis namespace faultString fault string actor fault actor details details; if null the current stack trace and classname is inserted into the details.
Parameters: code fault code which will be passed into the Axis namespace faultString fault string actor fault actor details details; if null the current stack trace and classname is inserted into the details.
Parameters: code fault code which will be passed into the Axis namespace subcodes fault subcodes which will be pased into the Axis namespace faultString fault string actor fault actor, same as fault role in SOAP 1.2 node which node caused the fault on the SOAP path details details; if null the current stack trace and classname is inserted into the details.
Since: axis1.1
Parameters: target the target Exception
Parameters: message
Parameters: message any extra text to with the fault t whatever is to be turned into a fault
Parameters: detail the new element to add
Since: Axis1.1
Parameters: qname qname of the element body string to use as body
Parameters: detail XML fragment
Parameters: code the QName
of the fault sub-code to add
Since: axis1.1
code
and namespace
Constants.NS_URI_AXIS
.
This is new in SOAP 1.2, ignored in SOAP 1.1
Parameters: code the local name of the code to add
Since: axis1.1
Parameters: header a SOAPHeaderElement containing some fault-relevant stuff
Parameters: hostname string name of a host
Since: Axis1.2
Since: Axis1.2
Since: axis1.1
Returns: stringified fault details
Returns: actor or null
QName
.
Returns: fault code QName or null if there is none yet.
Returns: an array of fault details, or null for none
Returns:
Since: axis1.1
Returns: a fault string
Returns: null for no subcodes, or a QName array
Since: axis1.1
Returns: an ArrayList containing any headers associated with this fault
Parameters: qname name of the node to look for
Returns: the matching element or null
Since: axis1.1
Parameters: e the Exception
to build a fault for
Returns: an AxisFault
representing e
Parameters: context
Throws: Exception
Parameters: ps where to print
Parameters: pw where to print
Parameters: qname qualified name of detail
Returns: true if it was found and removed, false otherwise
Since: axis1.1
Parameters: actor fault actor
Parameters: code a new fault code
Deprecated: expect to see this go away after 1.1, use setFaultCodeAsString instead!
Set the fault code (as a String).Parameters: code a new fault code
Parameters: code fault code
Parameters: details list of detail elements, can be null
Parameters: details XML fragment
Parameters: node a String
representing the fault node
Since: axis1.1
Parameters: str the fault reason as a String
Since: axis1.1
Since: axis1.1
Parameters: str new fault string; null is turned into ""
Returns: the fault string, possibly the empty string, but never null
Parameters: qname the QName
to write this under context the SerializationContext
to write this fault
to
Throws: java.io.IOException if we can't write ourselves for any reason