1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.ws.wsdl.wsdl11.provider;
18
19 import org.w3c.dom.Element;
20
21 import org.springframework.util.Assert;
22
23
24
25
26
27
28
29 public class SuffixBasedMessagesProvider extends DefaultMessagesProvider {
30
31
32 public static final String DEFAULT_REQUEST_SUFFIX = "Request";
33
34
35 public static final String DEFAULT_RESPONSE_SUFFIX = "Response";
36
37
38 public static final String DEFAULT_FAULT_SUFFIX = "Fault";
39
40 private String requestSuffix = DEFAULT_REQUEST_SUFFIX;
41
42 private String responseSuffix = DEFAULT_RESPONSE_SUFFIX;
43
44 private String faultSuffix = DEFAULT_FAULT_SUFFIX;
45
46
47
48
49
50
51 public String getRequestSuffix() {
52 return requestSuffix;
53 }
54
55
56
57
58
59
60 public void setRequestSuffix(String requestSuffix) {
61 Assert.hasText(requestSuffix, "'requestSuffix' must not be empty");
62 this.requestSuffix = requestSuffix;
63 }
64
65
66
67
68
69
70 public String getResponseSuffix() {
71 return responseSuffix;
72 }
73
74
75
76
77
78
79 public void setResponseSuffix(String responseSuffix) {
80 Assert.hasText(responseSuffix, "'responseSuffix' must not be empty");
81 this.responseSuffix = responseSuffix;
82 }
83
84
85
86
87
88
89 public String getFaultSuffix() {
90 return faultSuffix;
91 }
92
93
94
95
96
97
98 public void setFaultSuffix(String faultSuffix) {
99 Assert.hasText(faultSuffix, "'faultSuffix' must not be empty");
100 this.faultSuffix = faultSuffix;
101 }
102
103 @Override
104 protected boolean isMessageElement(Element element) {
105 if (super.isMessageElement(element)) {
106 String elementName = getElementName(element);
107 Assert.hasText(elementName, "Element has no name");
108 return elementName.endsWith(getRequestSuffix()) || elementName.endsWith(getResponseSuffix()) ||
109 elementName.endsWith(getFaultSuffix());
110 }
111 else {
112 return false;
113 }
114 }
115 }