Spring Boot & Apache CXF – SOAP on steroids fueled by cxf-spring-boot-starter

No Comments

You haven´t read any of this blog series’ articles yet? Perfectly fine – because the best is yet to come. We´ll now combine Spring Boot and Apache CXF in their own spring-boot-starter. By doing so, we’ll have our SOAP endpoints up and running even faster, while at the same time leveraging the power of all introduced features!

Spring Boot & Apache CXF – Tutorial

Part 1: Spring Boot & Apache CXF – How to SOAP in 2016
Part 2: Spring Boot & Apache CXF – Testing SOAP web services
Part 3: Spring Boot & Apache CXF – XML validation and custom SOAP faults
Part 4: Spring Boot & Apache CXF – Logging & Monitoring with Logback, Elasticsearch, Logstash & Kibana
Part 5: Spring Boot & Apache CXF – SOAP on steroids fueled by cxf-spring-boot-starter

In the preceding parts we learned a lot about how to work with Spring Boot and Apache CXF. There´s only one problem left: With every new SOAP endpoint we start from the first blog post´s steps and have to walk through all of them every time. We now have all those current technologies, but this is not feeling right and we somehow contravene DRY. But luckily enough, the Spring Boot guys also thought about this problem. Because it is possible to build a custom spring-boot-starter which brings in everything necessary for a special use case.

But wait! Isn´t there an official Apache CXF spring-boot-starter?

In the meantime the Apache CXF developers also became aware the absence of their own spring-boot-starter and just released one (thanks again for pointing that out Stéphane Nicoll 🙂 ). If one takes a deeper look at this spring-boot-starter, it soon becomes clear that it´s only focused on Apache CXF. Which is absolutely fine! But sadly for us this means that the spring-boot-starter just initializes Apache CXF. And that´s it. As described in the first article of this blog post series, this concerns the following code we can spare:

public ServletRegistrationBean dispatcherServlet() {
    return new ServletRegistrationBean(new CXFServlet(), "/soap-api/*");
public SpringBus springBus() {      
    return new SpringBus();

As mentioned, this is perfectly fine from the viewpoint of Apache CXF! But for us – embedded inside our enterprisey environments – this is not enough. Because with everything else, we are just left alone.

Introducing our own spring-boot-starter

Because of all this we decided to develop our own spring-boot-starter for Apache CXF that also brings in all the necessary surrounding technologies. We open-sourced it on GitHub.

But wait! Isn´t a spring-boot-starter a Spring developer´s exclusive way to make functionality available through Spring Boot? Hell no! Besides this huge list of starters from the Spring guys themselves, it´s possible for every developer to write their own one. And there are already quite a few on the official community contributions list.

The Spring Boot developers describe how to build your own spring-boot-starter on docs.spring.io. Additionally a colleague of mine summarized all the necessary steps in his blog article.

If you´re going to build your own starter, you´ll have the chance to deep-dive into the Spring Boot technology and gain a more profound understanding about this awesome framework. At the same time technically focused libraries aren´t developed multiple times and they can be used in all those projects with the same requirements. So building spring-boot-starters doesn´t contradict the thoughts behind the Microservices movement – it actually supports them. The exchange of technical libraries – ideally over GitHub – is explicitly encouraged.


Let´s get straight to the point: Similar to the spring-boot-starter-batch-web, we made the cxf-spring-boot-starter available on GitHub. It makes our developer´s life a whole lot easier and lightens our workload by doing all the stuff we otherwise have to do on our own. This includes:

Jonas Hecht

Trying to bridge the gap between software architecture and hands on coding, Jonas hired at codecentric. He has deep knowledge in all kinds of enterprise software development, paired with passion for new technology. Connecting systems via integration frameworks Jonas learned to not only get the hang of technical challenges.

Share on FacebookGoogle+Share on LinkedInTweet about this on TwitterShare on RedditDigg thisShare on StumbleUpon


Your email address will not be published. Required fields are marked *