O'Reilly logo

Mastering Spring Application Development by Anjana Mankale

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing a client application for Spring Web Services using JAXB unmarshalling for request

Let us write a simple client application for the author service. The org.springbyexample.ws.service package is scanned for beans and will find the AuthorServiceClient, and inject the web service template into it. The JAXB marshaller/umarshaller is defined and set on this template.

The import of the jetty-context.xml isn't relevant to creating a client, but it creates an embedded Jetty instance that loads the spring-ws-context.xml and its services. The client in the unit test is then able to run in isolation.

AuthorServiceClientTest.xml:

<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required