Book Image

Spring Web Services 2 Cookbook

By : Hamidreza Sattari, Shameer Kunjumohamed
Book Image

Spring Web Services 2 Cookbook

By: Hamidreza Sattari, Shameer Kunjumohamed

Overview of this book

<p>Spring Web Services is a product of the Spring community focused on creating document-driven Web services.<br /><br />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.<br /><br />This comprehensive guide -- which provides professional expertise on a variety of technical topics right from setting-up a contract-first Web-Service, creating client of a Web-Service to serialization, monitoring, testing and security using Spring-WS -- helps you enhance your skills in Spring Web Services.<br /><br />Spring Web Services 2 Cookbook includes a wide variety of recipes that covers most important topics used in real-world applications. It is a well-rounded guide covering a lot of ground in the Spring Web Services domain using systematic arranged chapters and focused recipes.<br /><br />The book begins with setting up a contract first Web Service over various protocols such as JMS, XMPP, and Email. The next chapter targets creating clients for SOAP Web Services. We then learn how to test and monitor the Web Service using tools like soapUI and TCPMon. Building on, logging, tracing and exception handling are detailed in the subsequent chapter. The book then covers marshalling and unmarshalling using different technologies like JAXB2, XMLBeans, JibX, XStream, MooseXML etc. Securing WebServices through authentication, authorization, encryption and decryption and digital signature using Spring-WS features based on XWSS and WSS4J Libraries is outlined in the next chapter two chapters. The book then tackles development of RESTful Web Services. Finally, Setting up Web Services using Spring Remoting based on various technologies like HTTP , RMI, JMS, JAXWS and a Web Service using Apache CXF on JAX-WS front-end are explained.<br /><br />This book will help relatively new developers in accelerating their learning process and experienced developers in expanding their skills sets of Spring Web Services.</p>
Table of Contents (17 chapters)
Spring Web Services 2 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Setting up a Web-Service client development environment within Eclipse


A Web-Service client in the simplest form is a Java class that calls a server-side Web-Service. In this recipe, setting up the environment to call a server-side Web-Service is presented. Here, a client-side Java class calls a Web-Service on the server in two forms. The first one is a Java class that calls a Web-Service in the main method of the class. The second one uses the JUnit test class to call the server-side Web-Service.

Getting ready

This recipe is similar to the recipe Using Maven for building and running a Spring-WS, discussed in Chapter 1, Building SOAP Web-Services.

  1. Download and install the Eclipse IDE for Java EE developers—Helios.

  2. In this recipe, the project's name is LiveRestaurant_R-2.1 (for server-side Web-Service), with the following Maven dependencies:

    • spring-ws-core-2.0.1.RELEASE.jar

    • jdom-1.0.jar

    • log4j-1.2.9.jar

    • jaxen-1.1.jarb

    • xalan-2.7.0.jar

  3. The LiveRestaurant_R-2.1-Client (for the client side) has...