Creates a new
SOAPFault
object and adds it to this
SOAPBody
object. The type of the
SOAPFault
will be a SOAP 1.1 or a SOAP 1.2
SOAPFault
depending on
the
protocol
specified while creating the
MessageFactory
instance.
For SOAP 1.2 the faultCode
parameter is the value of the
Fault/Code/Value element and the faultString
parameter
is the value of the Fault/Reason/Text element. For SOAP 1.1
the faultCode
parameter is the value of the faultcode
element and the faultString
parameter is the value of the faultstring
element.
In case of a SOAP 1.2 fault, the default value for the mandatory xml:lang
attribute on the Fault/Reason/Text element will be set to
java.util.Locale.getDefault()
A SOAPBody
may contain at most one SOAPFault
child element
Returns:
the new SOAPFault
object
Parameters:
- faultCode - a QName
object giving the fault code to be
set; must be one of the fault codes defined in the version
of SOAP specification in use
- faultString - a String
giving an explanation of the fault
Throws:
- SOAPException - if there is a SOAP error
Since:
SAAJ 1.3
See Also:
SOAPFault.setFaultCode(javax.xml.soap.Name)
,
SOAPFault.setFaultString(java.lang.String)
,
SOAPBody.addFault(Name faultCode, String faultString)
,