Spring Web Services with JAXB marshalling for request

In this section, let's look at developing a simple web service using the Spring Web Service framework. We need JAXB for marshalling and unmarshalling the XML request. The Spring Web Service supports contract first web service. We need to design a XSD/WSDL first and then launch the web service.

We are creating an author web service which will give us a list of authors.

  1. Configuring the web.xml file: Let us first do a web service configuration in a web.xml file. We need to configure the Spring Web Service servlet. The Message Dispatcher servlet needs to be defined and the URL patterns it will handle. The contextConfigLocation is specified instead of allowing the default (/WEB-INF/spring-ws-servlet.xml ...

Get Mastering Spring Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.