KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > ws > soap > SOAPFaultException


1 /*
2  * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
3  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4  */

5
6 package javax.xml.ws.soap;
7
8 import javax.xml.soap.SOAPFault JavaDoc;
9
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 JavaDoc 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 JavaDoc 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 JavaDoc getFault() {
53         return this.fault;
54     }
55 }
56
Popular Tags