background image

SOAPFaultTest to generate a SOAP

<< Running SOAPFaultTest | More Information on SAAJ >>
<< Running SOAPFaultTest | More Information on SAAJ >>
SOAPF
AULT
T
EST
.
JAVA
169
<SOAP-ENV:Header/><SOAP-ENV:Body>
<SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode>
<faultstring>Message does not have necessary info</faultstring>
<faultactor>http://gizmos.com/order</faultactor>
<detail>
<PO:order xmlns:PO="http://gizmos.com/orders/">
Quantity element does not have a value</PO:order>
<PO:confirmation xmlns:PO="http://gizmos.com/confirm">
Incomplete address: no zip code</PO:confirmation>
</detail></SOAP-ENV:Fault>
</SOAP-ENV:Body></SOAP-ENV:Envelope>
SOAP fault contains:
Fault code = {http://schemas.xmlsoap.org/soap/envelope/}Client
Local name = Client
Namespace prefix = SOAP-ENV, bound to
http://schemas.xmlsoap.org/soap/envelope/
Fault string = Message does not have necessary info
Fault actor = http://gizmos.com/order
Detail entry = Quantity element does not have a value
Detail entry = Incomplete address: no zip code
When you run SOAPFaultTest to generate a SOAP 1.2 message, the output looks
like this:
Here is what the XML message looks like:
<env:Envelope
xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header/><env:Body>
<env:Fault>
<env:Code><env:Value>env:Sender</env:Value></env:Code>
<env:Reason><env:Text xml:lang="en-US">
Message does not have necessary info
</env:Text></env:Reason>
<env:Role>http://gizmos.com/order</env:Role>
<env:Detail>
<PO:order xmlns:PO="http://gizmos.com/orders/">
Quantity element does not have a value</PO:order>
<PO:confirmation xmlns:PO="http://gizmos.com/confirm">
Incomplete address: no zip code</PO:confirmation>
</env:Detail></env:Fault>
</env:Body></env:Envelope>
SOAP fault contains:
Fault code = {http://www.w3.org/2003/05/soap-envelope}Sender
Local name = Sender
Namespace prefix = env, bound to