View Javadoc

1   /*
2    * Copyright 2006-2007 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springframework.ws.soap;
18  
19  import javax.xml.namespace.QName;
20  
21  /**
22   * Represents the <code>Fault</code> element in the body of a SOAP message.
23   * <p/>
24   * A fault consists of a {@link #getFaultCode() fault code}, {@link #getFaultActorOrRole fault string/reason}, and
25   * {@link #getFaultActorOrRole() role}.
26   *
27   * @author Arjen Poutsma
28   * @since 1.0.0
29   */
30  public interface SoapFault extends SoapElement {
31  
32      /** Returns the fault code. */
33      QName getFaultCode();
34  
35      /**
36       * Returns the fault string or reason. For SOAP 1.1, this returns the fault string. For SOAP 1.2, this returns the
37       * fault reason for the default locale.
38       */
39      String getFaultStringOrReason();
40  
41      /** Returns the fault actor or role. For SOAP 1.1, this returns the actor. For SOAP 1.2, this returns the role. */
42      String getFaultActorOrRole();
43  
44      /** Sets the fault actor. For SOAP 1.1, this sets the actor. For SOAP 1.2, this sets the role. */
45      void setFaultActorOrRole(String faultActor);
46  
47      /**
48       * Returns the optional detail element for this <code>SoapFault</code>.
49       *
50       * @return a fault detail
51       */
52      SoapFaultDetail getFaultDetail();
53  
54      /**
55       * Creates an optional <code>SoapFaultDetail</code> object and assigns it to this fault.
56       *
57       * @return the created detail
58       */
59      SoapFaultDetail addFaultDetail();
60  }