1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.ws.soap.axiom;
18
19 import java.util.Locale;
20 import javax.xml.namespace.QName;
21
22 import org.apache.axiom.om.OMAttribute;
23 import org.apache.axiom.soap.SOAPFactory;
24 import org.apache.axiom.soap.SOAPFault;
25 import org.springframework.ws.soap.axiom.support.AxiomUtils;
26 import org.springframework.ws.soap.soap11.Soap11Fault;
27
28
29
30
31
32
33
34 class AxiomSoap11Fault extends AxiomSoapFault implements Soap11Fault {
35
36 AxiomSoap11Fault(SOAPFault axiomFault, SOAPFactory axiomFactory) {
37 super(axiomFault, axiomFactory);
38 }
39
40 public QName getFaultCode() {
41 return getAxiomFault().getCode().getTextAsQName();
42 }
43
44 public String getFaultStringOrReason() {
45 if (getAxiomFault().getReason() != null) {
46 return getAxiomFault().getReason().getText();
47 }
48 return null;
49 }
50
51 public Locale getFaultStringLocale() {
52 if (getAxiomFault().getReason() != null) {
53 OMAttribute langAttribute =
54 getAxiomFault().getReason().getAttribute(new QName("http://www.w3.org/XML/1998/namespace", "lang"));
55 if (langAttribute != null) {
56 String xmlLangString = langAttribute.getAttributeValue();
57 if (xmlLangString != null) {
58 return AxiomUtils.toLocale(xmlLangString);
59 }
60
61 }
62 }
63 return null;
64 }
65
66 }