01: /*
02: * Copyright 2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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.Iterator;
20: import java.util.Locale;
21: import javax.xml.namespace.QName;
22: import javax.xml.soap.SOAPException;
23: import javax.xml.soap.SOAPFault;
24:
25: import org.springframework.ws.soap.soap12.Soap12Fault;
26:
27: /**
28: * @author Arjen Poutsma
29: * @since 1.0.0
30: */
31: class SaajSoap12Fault extends SaajSoapFault implements Soap12Fault {
32:
33: public SaajSoap12Fault(SOAPFault fault) {
34: super (fault);
35: }
36:
37: public String getFaultActorOrRole() {
38: return getImplementation().getFaultRole(getSaajFault());
39: }
40:
41: public void setFaultActorOrRole(String faultRole) {
42: try {
43: getImplementation().setFaultRole(getSaajFault(), faultRole);
44: } catch (SOAPException ex) {
45: throw new SaajSoapFaultException(ex);
46: }
47: }
48:
49: public Iterator getFaultSubcodes() {
50: return getImplementation().getFaultSubcodes(getSaajFault());
51: }
52:
53: public void addFaultSubcode(QName subcode) {
54: try {
55: getImplementation().appendFaultSubcode(getSaajFault(),
56: subcode);
57: } catch (SOAPException ex) {
58: throw new SaajSoapFaultException(ex);
59: }
60: }
61:
62: public String getFaultNode() {
63: return getImplementation().getFaultNode(getSaajFault());
64: }
65:
66: public void setFaultNode(String uri) {
67: try {
68: getImplementation().setFaultNode(getSaajFault(), uri);
69: } catch (SOAPException ex) {
70: throw new SaajSoapFaultException(ex);
71: }
72:
73: }
74:
75: public void setFaultReasonText(Locale locale, String text) {
76: try {
77: getImplementation().setFaultReasonText(getSaajFault(),
78: locale, text);
79: } catch (SOAPException ex) {
80: throw new SaajSoapFaultException(ex);
81: }
82:
83: }
84:
85: public String getFaultReasonText(Locale locale) {
86: try {
87: return getImplementation().getFaultReasonText(
88: getSaajFault(), locale);
89: } catch (SOAPException ex) {
90: throw new SaajSoapFaultException(ex);
91: }
92: }
93:
94: public String getFaultStringOrReason() {
95: return getFaultReasonText(Locale.getDefault());
96: }
97: }
|