Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Spring Releases Versions 2.3.1 and 2.4.0 Web Services

Spring Releases Versions 2.3.1 and 2.4.0 Web Services

This item in japanese

Spring recently announced updates of their Web Services project versions 2.3.1 and 2.4.0.

Version 2.3.1 is a minor patch release containing the following fixes:

Version 2.4.0 has refactored the code base to run on the latest versions of Spring Framework 4.3 and Spring Security 4.1. It was also designed to be forward compatible with Spring 5.0. Applications still running Java 7 can take advantage of this new version.

As defined on the Spring Web Services website:

Spring Web Services (Spring-WS) is a product of the Spring community focused on creating document-driven Web services. Spring Web Services aims to facilitate contract-first SOAP service development, allowing for the creation of flexible web services using one of the many ways to manipulate XML payloads.


People use Spring-WS for many reasons, but most are drawn to it after finding alternative SOAP stacks lacking when it comes to following Web service best practices. Spring-WS makes the best practice an easy practice. This includes practices such as the WS-I basic profile, Contract-First development, and having a loose coupling between contract and implementation.

The best practices mentioned above have been employed in Spring Web Services from the beginning. In January 2007, InfoQ interviewed Spring Web Services creator, Arjen Poutsma, when the project was in its infancy. When asked what made Spring Web Services unique, he replied:

Firstly, it's completely focused on contract-first Web service design. This basically means that you have to write your own XSD schema that defines the XML messages. You can refer to that schema in a WSDL (though Spring Web Services can also generate the WSDL from the XSD), and possibly use it for validation purposes.


Secondly, Spring Web Services provides a loose coupling between contract and implementation: there is no wsdl2java tool which directly ties the contract to a class; instead, you implement endpoints which handle the incoming XML in any way you want to (DOM, SAX, StAX, or even XML marshalling techniques such as JAXB, Castor, JIBX, or XMLBeans). The way you map incoming request to the endpoints is completely up to you: by default, we supply mappings that are based on message content, or the SOAPAction header. The main idea is that you're not handling method calls, but rather XML messages.

As Poutsma stated then, writing custom XSD schema is part of what defines the contract-first web service design, and the Spring Web Services Getting Started guides on how to consume and produce SOAP-based web services are still implemented this way today.

Refer to for a comprehensive SOAP-based example application that consumes its own produced web service for tracking student data. The entire project can be found on the GitHub repositories, webservices-soap-produce and webservices-soap-consume.

Spring Web Services remains unique today as it was almost ten years ago. Like all Spring projects, Spring Web Services is well integrated into the Spring ecosystem. It takes advantage of features such as Spring Security and configuring application contexts available to any project within the Spring Framework.

Rate this Article