Spring Web-Services (Spring-WS), introduced by the SpringSource community (http://www.springsource.org/), aims to create contract-first SOAP Web-Services in which either a WSDL or an XSD is required primarily for the creation of a Web-Service. Since Spring-WS is a Spring-based product, it takes advantage of Spring's concepts such as Inversion of Control (IOC) and dependency injection. Some of the key features of Spring-WS are:
Powerful endpoint mappings: The incoming XML requests can be forwarded to any handler object, based on the payload, SOAP action, and an XPath expression
Rich XML API support: The incoming XML messages can be read using a variety of Java's XML APIs such as DOM, JDOM, dom4j, and so on
Built by Maven: Spring-WS can be easily integrated with your Maven project
Support for Marshalling technologies: Several OXM technologies, such as JAXB, XMLBean, XStream, and JiBX, can be used alternatively for the conversion of XML messages to/from an object
Security support: Security operations, such as encryption/decryption, signature, and authentication
Covering all of these key features of Spring-WS 2.x has been the main goal of this book.
However, in the last two chapters, a different approach toward Web-Service development using REST-style and contract-last development using Spring remoting feature are detailed.
Chapter 1, Building SOAP Web-Services: This chapter covers setting up SOAP Web-Services over HTTP, JMS, XMPP, and E-mail protocols. It also covers the different implementations of Web-Service's endpoint using technologies such as DOM, JDOM, XPath, and Marshaller.
Chapter 2, Building Clients for SOAP Web-Services: This chapters covers building SOAP Web-Services clients over HTTP, JMS, XMPP, and E-mail protocols, using Spring-WS template classes.
Chapter 3, Testing and Monitoring Web-Services: This chapter explains the testing of Web-Services using the latest features of Spring-WS and monitoring a Web-Service using tools such as soapUI and TCPMon.
Chapter 4, Exception/SOAP Fault Handling: This chapter explains exception handling in the case of application/system failure.
Chapter 5, Logging and Tracing of SOAP Messages: In this chapter, we will see how to log important events and trace Web-Services.
Chapter 6, Marshalling and Object-XML Mapping (OXM): We will discuss marshalling/un-marshalling technologies as well as creating a custom marshaller in this chapter.
Chapter 7, Securing SOAP Web-Services using XWSS Library: This chapter covers security topics, such as encryption, decryption, digital signature authentication, and authorization using the Spring-WS feature, based on XWSS, and has a recipe about creating key stores.
Chapter 8, Securing SOAP Web-Services using WSS4J Library: In this chapter, we will see security topics, such as encryption, decryption, digital signature authentication, and authorization using the Spring-WS feature, based on the WSS4J package.
Chapter 9, RESTful Web-Services: This chapter explains REST Web-Service development using RESTful support in Spring.
Chapter 10, Spring Remoting: We will discuss contract-last Web-Service development using Spring remoting features to expose local business services as a Web-Service using Hessian/Burlap, JAX-WS, JMS, and a recipe to set up a Web-Service by Apache CXF using JAX-WS API.
Java knowledge as well as basic Maven knowledge is a prerequisite. Having experience with Web-Service makes it easier for you to use recipes in your development environment, professionally. Basic recipes in the book help beginners learn Web-Service topics quickly.
This book is for those Java/J2EE developers that either have experience with Web-Service and for beginners. Since this book covers a variety of topics in Web-Service development, those who are already familiar with Web-Service can benefit from the book as a reference. Beginners can use this book to gain real-world experience of Web-Service development rapidly.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "MessageDispatcherServlet is the core component of Spring-WS."
A block of code is set as follows:
<context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/classes/applicationContext.xml</param-value> </context-param>
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
<tns:placeOrderRequest ...>
<tns:order>
......
</tns:order>
</tns:placeOrderRequest>
Any command-line input or output is written as follows:
mvn clean package tomcat:run
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "You can click on the JUnit tab, adjacent to the Console tab, to see whether the test case has succeeded or not".
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book — what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to [email protected], and mention the book title via the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail [email protected].
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books — maybe a mistake in the text or the code we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at [email protected] with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at [email protected] if you are having a problem with any aspect of the book, and we will do our best to address it.