This tutorial demonstrates how to develop a web service with Spring WS.
It’s a contract first web service that uses JAXB for the binding.
This is a different approach than for example CXF that generates an interface your implementation must implement.
The sample XML request document that I will create an XSD schema from: Now I have created the data contract part of the WSDL and generated the data binding classes used to parse the Java object to XML. You don’t need to create a WSDL file with Spring WS.
The WSDL file is generated from one or more XSD schemas and some few Spring configuration beans. The request element must end with Request and the response element must end with Response. The WSDL operation will be the element names except the Request/Response part.
Exceptions that are thrown during handling of the request get picked up by any of the endpoint exception resolvers that are declared in the application context.
Using these exception resolvers allows you to define custom behaviors (such as returning a SOAP Fault) in case such exceptions get thrown.