1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.student.common.ws.beans; |
17 |
|
|
18 |
|
import java.net.URL; |
19 |
|
|
20 |
|
import javax.xml.namespace.QName; |
21 |
|
import javax.xml.ws.BindingProvider; |
22 |
|
import javax.xml.ws.Service; |
23 |
|
|
24 |
|
import org.springframework.core.io.ClassPathResource; |
25 |
|
|
|
|
| 47.7% |
Uncovered Elements: 23 (44) |
Complexity: 18 |
Complexity Density: 0.75 |
|
26 |
|
public class JaxWsClientFactoryBean implements JaxWsClientFactory { |
27 |
|
private Class<?> serviceEndpointInterface = null; |
28 |
|
private String wsdlDocumentLocation = ""; |
29 |
|
private QName serviceQName = null; |
30 |
|
private String serviceUrl = ""; |
31 |
|
private static final String CLASSPATH_PREFIX = "classpath:"; |
32 |
|
private Object client; |
33 |
|
|
|
|
| 70.6% |
Uncovered Elements: 5 (17) |
Complexity: 5 |
Complexity Density: 0.45 |
|
34 |
147
|
@Override... |
35 |
|
public synchronized Object getObject() throws Exception { |
36 |
147
|
if(client==null){ |
37 |
147
|
URL url; |
38 |
147
|
if (wsdlDocumentLocation.startsWith(CLASSPATH_PREFIX)) { |
39 |
0
|
ClassPathResource cpr = new ClassPathResource(wsdlDocumentLocation.substring(CLASSPATH_PREFIX.length())); |
40 |
0
|
url = cpr.getURL(); |
41 |
|
} else { |
42 |
147
|
url = new URL(wsdlDocumentLocation); |
43 |
|
} |
44 |
147
|
Service service = Service.create(url, serviceQName); |
45 |
147
|
client = service.getPort(serviceEndpointInterface); |
46 |
|
|
47 |
147
|
if (this.serviceUrl != null && !"".equals(this.serviceUrl)) { |
48 |
147
|
((BindingProvider) client).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, this.serviceUrl); |
49 |
|
} |
50 |
|
} |
51 |
|
|
52 |
147
|
return client; |
53 |
|
} |
54 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
55 |
0
|
@Override... |
56 |
|
public Class<?> getObjectType() { |
57 |
0
|
return serviceEndpointInterface; |
58 |
|
} |
59 |
|
|
60 |
|
|
61 |
|
@return |
62 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
63 |
0
|
public Class<?> getServiceEndpointInterface() {... |
64 |
0
|
return serviceEndpointInterface; |
65 |
|
} |
66 |
|
|
67 |
|
|
68 |
|
@param |
69 |
|
|
70 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
71 |
147
|
public void setServiceEndpointInterface(Class<?> serviceEndpointInterface) {... |
72 |
147
|
this.serviceEndpointInterface = serviceEndpointInterface; |
73 |
|
} |
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
@param |
78 |
|
|
79 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
80 |
0
|
public void setServiceQNameString(String serviceName) {... |
81 |
0
|
this.serviceQName = QName.valueOf(serviceName); |
82 |
|
} |
83 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
84 |
0
|
@Override... |
85 |
|
public boolean isSingleton() { |
86 |
0
|
return true; |
87 |
|
} |
88 |
|
|
89 |
|
|
90 |
|
@return |
91 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
92 |
0
|
public String getWsdlLocation() {... |
93 |
0
|
return wsdlDocumentLocation; |
94 |
|
} |
95 |
|
|
96 |
|
|
97 |
|
@param |
98 |
|
|
99 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
147
|
public void setWsdlLocation(String wsdlDocumentLocation) {... |
101 |
147
|
this.wsdlDocumentLocation = wsdlDocumentLocation; |
102 |
|
} |
103 |
|
|
104 |
|
|
105 |
|
@return |
106 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
107 |
0
|
public String getAddress() {... |
108 |
0
|
return serviceUrl; |
109 |
|
} |
110 |
|
|
111 |
|
|
112 |
|
@param |
113 |
|
|
114 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
115 |
147
|
public void setAddress(String add) {... |
116 |
147
|
this.serviceUrl = add; |
117 |
|
} |
118 |
|
|
119 |
|
|
120 |
|
@return |
121 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
122 |
0
|
public QName getServiceQName() {... |
123 |
0
|
return serviceQName; |
124 |
|
} |
125 |
|
|
126 |
|
|
127 |
|
@param |
128 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
129 |
0
|
public void setServiceQName(QName serviceQName) {... |
130 |
0
|
this.serviceQName = serviceQName; |
131 |
|
} |
132 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
133 |
0
|
@Override... |
134 |
|
public QName getServiceName() { |
135 |
0
|
return serviceQName; |
136 |
|
} |
137 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
138 |
147
|
@Override... |
139 |
|
public void setServiceName(QName serviceName) { |
140 |
147
|
this.serviceQName = serviceName; |
141 |
|
} |
142 |
|
|
143 |
|
} |