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 org.apache.axiom.om.OMException;
20 import org.apache.axiom.soap.SOAPFactory;
21 import org.apache.axiom.soap.SOAPFault;
22 import org.apache.axiom.soap.SOAPFaultDetail;
23 import org.apache.axiom.soap.SOAPFaultRole;
24 import org.apache.axiom.soap.SOAPProcessingException;
25 import org.springframework.ws.soap.SoapFault;
26 import org.springframework.ws.soap.SoapFaultDetail;
27
28
29 abstract class AxiomSoapFault extends AxiomSoapElement implements SoapFault {
30
31 protected AxiomSoapFault(SOAPFault axiomFault, SOAPFactory axiomFactory) {
32 super(axiomFault, axiomFactory);
33 }
34
35 public String getFaultActorOrRole() {
36 SOAPFaultRole faultRole = getAxiomFault().getRole();
37 return faultRole != null ? faultRole.getRoleValue() : null;
38 }
39
40 public void setFaultActorOrRole(String actor) {
41 try {
42 SOAPFaultRole axiomFaultRole = getAxiomFactory().createSOAPFaultRole(getAxiomFault());
43 axiomFaultRole.setRoleValue(actor);
44 }
45 catch (SOAPProcessingException ex) {
46 throw new AxiomSoapFaultException(ex);
47 }
48
49 }
50
51 public SoapFaultDetail getFaultDetail() {
52 try {
53 SOAPFaultDetail axiomFaultDetail = getAxiomFault().getDetail();
54 return axiomFaultDetail != null ? new AxiomSoapFaultDetail(axiomFaultDetail, getAxiomFactory()) : null;
55 }
56 catch (OMException ex) {
57 throw new AxiomSoapFaultException(ex);
58 }
59
60 }
61
62 public SoapFaultDetail addFaultDetail() {
63 try {
64 SOAPFaultDetail axiomFaultDetail = getAxiomFactory().createSOAPFaultDetail(getAxiomFault());
65 return new AxiomSoapFaultDetail(axiomFaultDetail, getAxiomFactory());
66 }
67 catch (OMException ex) {
68 throw new AxiomSoapFaultException(ex);
69 }
70
71 }
72
73 protected SOAPFault getAxiomFault() {
74 return (SOAPFault) getAxiomElement();
75 }
76
77 }