Book Image

Mastering Spring Application Development

By : Anjana Mankale
Book Image

Mastering Spring Application Development

By: Anjana Mankale

Overview of this book

Table of Contents (19 chapters)
Mastering Spring Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Spring with JAX-WS


In this section, let's create a simple JAX-WS web service. We shall also see how we can integrate the JAX-WS Web Service with Spring. JAX-WS is the latest version of JAX-RPC, which used remote method invocation protocol to access Web services.

All we need to do here is to expose Spring's service layer as JAX_WS service provider layer. This can be done using the @webservice annotation and involves just a few steps. Let us jot down the steps involved in it.

  1. Create a PACKTJAXWS-Spring simple Maven web project or a Dynamic web project in Eclipse.

  2. Now, we need to configure JAX-WS servlet in a web.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
    <display-name>JAXWS-Spring</display-name>
    <servlet>
      <servlet-name...