@@ -53,22 +53,14 @@ public class CxfAutoConfiguration {
53
53
@ Value ("${cxf.servicelist.title:CXF SpringBoot Starter - service list}" )
54
54
private String serviceListTitle ;
55
55
56
- private String serviceUrlEnding = "" ;
56
+ private String serviceUrlEnding = null ;
57
57
private Object seiImplementation ;
58
- private Service webServiceClient ;
59
-
60
58
61
59
@ Bean
62
60
public WebServiceAutoDetector webServiceAutoDetector (ApplicationContext applicationContext ) throws BootStarterCxfException {
63
61
return new WebServiceAutoDetector (new WebServiceScanner (), applicationContext );
64
62
}
65
63
66
- @ PostConstruct
67
- public void setUp () throws BootStarterCxfException {
68
- webServiceClient = webServiceAutoDetector (null ).searchAndInstantiateWebServiceClient ();
69
- serviceUrlEnding = "/" + webServiceClient ().getServiceName ().getLocalPart ();
70
- }
71
-
72
64
/**
73
65
* We mostly want to autoinitialize the Endpoint and the CXFServlet.
74
66
* But when in client mode, this isn´t always wanted (e.g. when you are in Client
@@ -126,7 +118,7 @@ public Endpoint endpoint() throws BootStarterCxfException {
126
118
endpoint .setServiceName (webServiceClient ().getServiceName ());
127
119
endpoint .setWsdlLocation (webServiceClient ().getWSDLDocumentLocation ().toString ());
128
120
if (publishedEndpointUrl .equals ("NOT_SET" )) {
129
- endpoint .setPublishedEndpointUrl (webServiceClient .getServiceName ().getLocalPart ());
121
+ endpoint .setPublishedEndpointUrl (webServiceClient () .getServiceName ().getLocalPart ());
130
122
} else {
131
123
endpoint .setPublishedEndpointUrl (publishedEndpointUrl );
132
124
}
@@ -138,7 +130,7 @@ public Endpoint endpoint() throws BootStarterCxfException {
138
130
@ Bean
139
131
public Service webServiceClient () throws BootStarterCxfException {
140
132
// Needed for correct ServiceName & WSDLLocation to publish contract first incl. original WSDL
141
- return webServiceClient ;
133
+ return webServiceAutoDetector ( null ). searchAndInstantiateWebServiceClient () ;
142
134
}
143
135
144
136
/**
@@ -152,7 +144,10 @@ public String baseUrl() {
152
144
* @return the concrete Service URL-ending, where the WebService is configured according to your WSDL´s Service Name
153
145
* (e.g. "/Weather" when there is this inside your WSDL: <wsdl:service name="Weather">)
154
146
*/
155
- public String serviceUrlEnding () {
147
+ public String serviceUrlEnding () throws BootStarterCxfException {
148
+ if (serviceUrlEnding == null ) {
149
+ serviceUrlEnding = "/" + webServiceClient ().getServiceName ().getLocalPart ();
150
+ }
156
151
return serviceUrlEnding ;
157
152
}
158
153
@@ -161,7 +156,7 @@ public String serviceUrlEnding() {
161
156
* the concrete Service URL-ending, where the WebService is configured according to your WSDL´s Service Name
162
157
* (e.g. "/Weather" when there is this inside your WSDL: <wsdl:service name="Weather">)
163
158
*/
164
- public String baseAndServiceEndingUrl () {
159
+ public String baseAndServiceEndingUrl () throws BootStarterCxfException {
165
160
return baseUrl () + serviceUrlEnding ();
166
161
}
167
162
0 commit comments