View Javadoc

1   /*
2    * Copyright 2006 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.saaj;
18  
19  import java.util.Locale;
20  import javax.xml.soap.SOAPException;
21  import javax.xml.soap.SOAPFault;
22  
23  import org.springframework.ws.soap.soap11.Soap11Fault;
24  
25  /**
26   * SAAJ-specific implementation of the <code>Soap11Fault</code> interface. Wraps a [email protected] javax.xml.soap.SOAPFault}.
27   *
28   * @author Arjen Poutsma
29   * @since 1.0.0
30   */
31  class SaajSoap11Fault extends SaajSoapFault implements Soap11Fault {
32  
33      SaajSoap11Fault(SOAPFault fault) {
34          super(fault);
35      }
36  
37      public String getFaultActorOrRole() {
38          return getImplementation().getFaultActor(getSaajFault());
39      }
40  
41      public void setFaultActorOrRole(String faultActor) {
42          try {
43              getImplementation().setFaultActor(getSaajFault(), faultActor);
44          }
45          catch (SOAPException ex) {
46              throw new SaajSoapFaultException(ex);
47          }
48      }
49  
50      public String getFaultStringOrReason() {
51          return getImplementation().getFaultString(getSaajFault());
52      }
53  
54      public Locale getFaultStringLocale() {
55          return getImplementation().getFaultStringLocale(getSaajFault());
56      }
57  }