Spring Web Services
Exercise: Todo SOAP Service (Code-first)
The objective of this exercise is to implement a SOAP-based todo web service using Spring Boot and Apache CXF.
Assignment
- Preparation
- Remove the client artifacts from the todo application
- Add the
org.apache.cxf:cxf-spring-boot-starter-jaxws dependency to the Maven project
- Service implementation
- Annotate the
TodoListImpl class as web service using JAX-WS annotations
- Annotate the methods as web service operations using appropriate names
- Define the
removeTodo method as oneway operation
- Make the
TodoNotFoundException a JAX-WS compatible exception
- Configuration (see Apache CXF documentation)
- Implement the configuration class
WebServiceConfig with a bean method that returns an endpoint of the published TodoListService class
- Define the
cxf.path application property as /soap to customize the URL pattern of the CXFServlet
- Testing
Solution