public class AxisFault extends RemoteException
Modifier and Type | Field and Description |
---|---|
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 org.apache.commons.logging.Log |
log
The
Log used by this class for all logging. |
detail
Modifier | Constructor and Description |
---|---|
|
AxisFault()
No-arg constructor for building one from an XML stream.
|
protected |
AxisFault(Exception target)
Wrap an AxisFault around an existing Exception.
|
|
AxisFault(QName code,
QName[] subcodes,
String faultString,
String actor,
String node,
Element[] details)
Make a fault in any namespace.
|
|
AxisFault(QName code,
String faultString,
String actor,
Element[] details)
Make a fault in any namespace.
|
|
AxisFault(String message)
create a simple axis fault from the message.
|
|
AxisFault(String code,
String faultString,
String actor,
Element[] details)
Make a fault in the
Constants.NS_URI_AXIS namespace. |
|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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)
Deprecated.
expect to see this go away after 1.1, use
setFaultCodeAsString instead!
|
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
setFaultString(java.lang.String) . |
void |
setFaultRole(String role)
This is SOAP 1.2 equivalent of
setFaultActor(java.lang.String) . |
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.
|
getCause, getMessage
addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace
protected static org.apache.commons.logging.Log log
Log
used by this class for all logging.protected QName faultCode
protected Vector faultSubCode
protected String faultString
protected String faultActor
protected Vector faultDetails
protected String faultNode
protected ArrayList faultHeaders
public AxisFault(String code, String faultString, String actor, Element[] details)
Constants.NS_URI_AXIS
namespace.code
- fault code which will be passed into the Axis namespacefaultString
- fault stringactor
- fault actordetails
- details; if null the current stack trace and classname is
inserted into the details.public AxisFault(QName code, String faultString, String actor, Element[] details)
code
- fault code which will be passed into the Axis namespacefaultString
- fault stringactor
- fault actordetails
- details; if null the current stack trace and classname is
inserted into the details.public AxisFault(QName code, QName[] subcodes, String faultString, String actor, String node, Element[] details)
code
- fault code which will be passed into the Axis namespacesubcodes
- fault subcodes which will be pased into the Axis namespacefaultString
- fault stringactor
- fault actor, same as fault role in SOAP 1.2node
- which node caused the fault on the SOAP pathdetails
- details; if null the current stack trace and classname is
inserted into the details.protected AxisFault(Exception target)
target
- the target Exception
public AxisFault(String message)
message
- public AxisFault()
public static AxisFault makeFault(Exception e)
e
- the Exception
to build a fault forAxisFault
representing e
public void clearFaultDetails()
public void dump()
public String dumpToString()
public void setFaultCode(QName code)
code
- a new fault codepublic void setFaultCode(String code)
code
- a new fault codepublic void setFaultCodeAsString(String code)
code
- fault codepublic QName getFaultCode()
QName
.public void addFaultSubCodeAsString(String code)
code
and namespace
Constants.NS_URI_AXIS
.
This is new in SOAP 1.2, ignored in SOAP 1.1code
- the local name of the code to addprotected void initFaultSubCodes()
public void addFaultSubCode(QName code)
code
- the QName
of the fault sub-code to addpublic void clearFaultSubCodes()
public QName[] getFaultSubCodes()
public void setFaultString(String str)
str
- new fault string; null is turned into ""public String getFaultString()
public void setFaultReason(String str)
setFaultString(java.lang.String)
.str
- the fault reason as a String
public String getFaultReason()
getFaultString()
.String
public void setFaultActor(String actor)
actor
- fault actorpublic String getFaultActor()
public String getFaultRole()
getFaultActor()
.public void setFaultRole(String role)
setFaultActor(java.lang.String)
.public String getFaultNode()
public void setFaultNode(String node)
node
- a String
representing the fault nodepublic void setFaultDetail(Element[] details)
details
- list of detail elements, can be nullpublic void setFaultDetailString(String details)
details
- XML fragmentpublic void addFaultDetailString(String detail)
detail
- XML fragmentpublic void addFaultDetail(Element detail)
detail
- the new element to addpublic void addFaultDetail(QName qname, String body)
qname
- qname of the elementbody
- string to use as bodypublic Element[] getFaultDetails()
public Element lookupFaultDetail(QName qname)
qname
- name of the node to look forpublic boolean removeFaultDetail(QName qname)
qname
- qualified name of detailpublic void output(SerializationContext context) throws Exception
context
- Exception
public String toString()
public void printStackTrace(PrintStream ps)
printStackTrace
in class Throwable
ps
- where to printpublic void printStackTrace(PrintWriter pw)
printStackTrace
in class Throwable
pw
- where to printpublic void addHeader(SOAPHeaderElement header)
header
- a SOAPHeaderElement containing some fault-relevant stuffpublic ArrayList getHeaders()
public void clearHeaders()
public void writeDetails(QName qname, SerializationContext context) throws IOException
qname
- the QName
to write this undercontext
- the SerializationContext
to write this fault
toIOException
- if we can't write ourselves for any reasonpublic void addHostnameIfNeeded()
public void addHostname(String hostname)
hostname
- string name of a hostpublic void removeHostname()
Copyright © The Apache Software Foundation. All Rights Reserved.