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.soap12;
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.2 functionality. Necessary because SOAP 1.1 differs from
27   * SOAP 1.2 with respect to SOAP Faults.
28   *
29   * @author Arjen Poutsma
30   * @since 1.0.0
31   */
32  public interface Soap12Body extends SoapBody {
33  
34      /**
35       * Adds a <code>DataEncodingUnknown</code> fault to the body.
36       * <p/>
37       * Adding a fault removes the current content of the body.
38       *
39       * @param subcodes the optional fully qualified fault subcodes
40       * @param reason   the fault reason
41       * @param locale   the language of the fault reason
42       * @return the created <code>SoapFault</code>
43       */
44      Soap12Fault addDataEncodingUnknownFault(QName[] subcodes, String reason, Locale locale) throws SoapFaultException;
45      
46      Soap12Fault getFault();
47  
48      Soap12Fault addMustUnderstandFault(String faultStringOrReason, Locale locale) throws SoapFaultException;
49  
50      Soap12Fault addClientOrSenderFault(String faultStringOrReason, Locale locale) throws SoapFaultException;
51  
52      Soap12Fault addServerOrReceiverFault(String faultStringOrReason, Locale locale) throws SoapFaultException;
53  
54      Soap12Fault addVersionMismatchFault(String faultStringOrReason, Locale locale) throws SoapFaultException;
55      
56  }