|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.ws.fault.SOAPFaultBuilder
public abstract class SOAPFaultBuilder
Base class that represents SOAP 1.1 or SOAP 1.2 fault. This class can be used by the invocation handlers to create an Exception from a received messge.
Field Summary | |
---|---|
(package private) static String |
CAPTURE_STACK_TRACE_PROPERTY
|
static boolean |
captureStackTrace
Set to false if you don't want the generated faults to have stack trace in it. |
Constructor Summary | |
---|---|
SOAPFaultBuilder()
|
Method Summary | |
---|---|
(package private) void |
captureStackTrace(Throwable t)
Creates a DOM node that represents the complete stack trace of the exception, and attach that to DetailType . |
static SOAPFaultBuilder |
create(Message msg)
Parses a fault Message and returns it as a SOAPFaultBuilder . |
Throwable |
createException(Map<QName,CheckedExceptionImpl> exceptions)
This should be called from the client side to throw an Exception for a given soap mesage |
static Message |
createSOAPFaultMessage(SOAPVersion soapVersion,
CheckedExceptionImpl ceModel,
Throwable ex)
To be called by the server runtime in the situations when there is an Exception that needs to be transformed in to a soapenv:Fault payload. |
static Message |
createSOAPFaultMessage(SOAPVersion soapVersion,
javax.xml.ws.ProtocolException ex,
QName faultcode)
To be called to convert a ProtocolException and faultcode for a given SOAPVersion in to a Message . |
static Message |
createSOAPFaultMessage(SOAPVersion soapVersion,
javax.xml.soap.SOAPFault fault)
|
static Message |
createSOAPFaultMessage(SOAPVersion soapVersion,
String faultString,
QName faultCode)
Server runtime will call this when there is some internal error not resulting from an exception. |
(package private) abstract DetailType |
getDetail()
Gives the DetailType for a Soap 1.1 or Soap 1.2 message that can be used to create either a checked exception or
a protocol specific exception |
(package private) abstract String |
getFaultString()
gives the fault string that can be used to create an Exception |
protected abstract Throwable |
getProtocolException()
|
(package private) abstract void |
setDetail(DetailType detailType)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean captureStackTrace
static final String CAPTURE_STACK_TRACE_PROPERTY
Constructor Detail |
---|
public SOAPFaultBuilder()
Method Detail |
---|
abstract DetailType getDetail()
DetailType
for a Soap 1.1 or Soap 1.2 message that can be used to create either a checked exception or
a protocol specific exception
abstract void setDetail(DetailType detailType)
abstract String getFaultString()
Exception
public Throwable createException(Map<QName,CheckedExceptionImpl> exceptions) throws JAXBException
Exception
for a given soap mesage
JAXBException
@NotNull public static Message createSOAPFaultMessage(@NotNull SOAPVersion soapVersion, @NotNull javax.xml.ws.ProtocolException ex, @Nullable QName faultcode)
ProtocolException
and faultcode for a given SOAPVersion
in to a Message
.
soapVersion
- SOAPVersion.SOAP_11
or SOAPVersion.SOAP_12
ex
- a ProtocolExceptionfaultcode
- soap faultcode. Its ignored if the ProtocolException
instance is SOAPFaultException
and it has a
faultcode present in the underlying SOAPFault
.
Message
representing SOAP faultpublic static Message createSOAPFaultMessage(SOAPVersion soapVersion, CheckedExceptionImpl ceModel, Throwable ex)
ceModel
- CheckedExceptionImpl
model that provides useful informations such as the detail tagname
and the Exception associated with it. Caller of this constructor should get the CheckedException
model by calling JavaMethodImpl.getCheckedException(Class)
, where
Class is t.getClass().
If its null then this is not a checked exception and in that case the soap fault will be serialized only from the exception as described below.
ex
- Exception that needs to be translated into soapenv:Fault, always non-null.
SOAPFaultException
then its serilaized as protocol exception.
SOAPFaultException
and t is a checked exception then
the soap fault detail is serilaized from t and the fault actor/string/role is taken from t.getCause().
soapVersion
- non-nullpublic static Message createSOAPFaultMessage(SOAPVersion soapVersion, String faultString, QName faultCode)
soapVersion
- SOAPVersion.SOAP_11
or SOAPVersion.SOAP_12
faultString
- must be non-nullfaultCode
- For SOAP 1.1, it must be one of
For SOAP 1.2
Message
public static Message createSOAPFaultMessage(SOAPVersion soapVersion, javax.xml.soap.SOAPFault fault)
final void captureStackTrace(@Nullable Throwable t)
DetailType
.
protected abstract Throwable getProtocolException()
public static SOAPFaultBuilder create(Message msg) throws JAXBException
Message
and returns it as a SOAPFaultBuilder
.
JAXBException
- if the parsing fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |