View Javadoc
1   /*
2    * Copyright 2005-2010 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.soap11;
18  
19  import java.util.Locale;
20  import javax.xml.namespace.QName;
21  
22  import org.springframework.ws.soap.SoapBody;
23  import org.springframework.ws.soap.SoapFaultException;
24  
25  /**
26   * Subinterface of <code>SoapBody</code> that exposes SOAP 1.1 functionality. Necessary because SOAP 1.1 differs from
27   * SOAP 1.2 with respect to SOAP Faults.
28   *
29   * @author Arjen Poutsma
30   * @see Soap11Fault
31   * @since 1.0.0
32   */
33  public interface Soap11Body extends SoapBody {
34  
35      /**
36       * Adds a SOAP 1.1 <faultCode>Fault</faultCode> to the body with a localized message. Adding a fault removes the
37       * current content of the body.
38       *
39       * @param faultCode         the fully qualified fault faultCode
40       * @param faultString       the faultString
41       * @param faultStringLocale the faultString locale. May be <code>null</code>
42       * @return the added <faultCode>Soap11Fault</faultCode>
43       * @throws IllegalArgumentException if the fault faultCode is not fully qualified
44       */
45      Soap11Fault addFault(QName faultCode, String faultString, Locale faultStringLocale) throws SoapFaultException;
46  
47      Soap11Fault getFault();
48  
49      Soap11Fault addMustUnderstandFault(String faultStringOrReason, Locale locale) throws SoapFaultException;
50  
51      Soap11Fault addClientOrSenderFault(String faultStringOrReason, Locale locale) throws SoapFaultException;
52  
53      Soap11Fault addServerOrReceiverFault(String faultStringOrReason, Locale locale) throws SoapFaultException;
54  
55      Soap11Fault addVersionMismatchFault(String faultStringOrReason, Locale locale) throws SoapFaultException;
56  }