01: /*
02: * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
03: * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
04: */
05:
06: package javax.xml.ws.soap;
07:
08: import javax.xml.soap.SOAPFault;
09:
10: /** The <code>SOAPFaultException</code> exception represents a
11: * SOAP 1.1 or 1.2 fault.
12: *
13: * <p>A <code>SOAPFaultException</code> wraps a SAAJ <code>SOAPFault</code>
14: * that manages the SOAP-specific representation of faults.
15: * The <code>createFault</code> method of
16: * <code>javax.xml.soap.SOAPFactory</code> may be used to create an instance
17: * of <code>javax.xml.soap.SOAPFault</code> for use with the
18: * constructor. <code>SOAPBinding</code> contains an accessor for the
19: * <code>SOAPFactory</code> used by the binding instance.
20: *
21: * <p>Note that the value of <code>getFault</code> is the only part of the
22: * exception used when searializing a SOAP fault.
23: *
24: * <p>Refer to the SOAP specification for a complete
25: * description of SOAP faults.
26: *
27: * @see javax.xml.soap.SOAPFault
28: * @see javax.xml.ws.soap.SOAPBinding#getSOAPFactory
29: * @see javax.xml.ws.ProtocolException
30: *
31: * @since JAX-WS 2.0
32: **/
33: public class SOAPFaultException extends javax.xml.ws.ProtocolException {
34:
35: private SOAPFault fault;
36:
37: /** Constructor for SOAPFaultException
38: * @param fault <code>SOAPFault</code> representing the fault
39: *
40: * @see javax.xml.soap.SOAPFactory#createFault
41: **/
42: public SOAPFaultException(SOAPFault fault) {
43: super (fault.getFaultString());
44: this .fault = fault;
45: }
46:
47: /** Gets the embedded <code>SOAPFault</code> instance.
48: *
49: * @return <code>javax.xml.soap.SOAPFault</code> SOAP
50: * fault element
51: **/
52: public javax.xml.soap.SOAPFault getFault() {
53: return this.fault;
54: }
55: }
|