2. 2
About me
Jonas Hecht,
Senior IT-Consultant
https://blog.codecentric.de/
author/jonas-hecht/
jonas.hecht@codecentric.de
@jonashackt
github.com/jonashackt
29. 29
Complete Howto:
https://blog.codecentric.de/
2016/02/spring-boot-apache-cxf/
à http://start.spring.io/
group: de.codecentric.webservice
artifact: simpleservice
Web & Devtools
Demo: web service with Apache CXF 1/4
CXF-Dependencies
<!-- Apache CXF -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.1.7</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.1.7</version>
</dependency>
30. 30
Demo: web service with Apache CXF 2/4
@Bean
public ServletRegistrationBean dispatcherServlet() {
return new ServletRegistrationBean(new CXFServlet(), "/soap-
api/*");
}
@Bean(name= Bus.DEFAULT_BUS_ID)
public SpringBus springBus() {
return new SpringBus();
}
32. 32
@Bean
public WeatherService weatherService() {
return new WeatherServiceEndpoint();
}
@Bean
public Endpoint endpoint() {
EndpointImpl endpoint = new EndpointImpl(springBus(), weatherService());
endpoint.publish("/WeatherSoapService_1.0");
return endpoint;
}
Demo: web service with Apache CXF 4/4