What is this?

When your application uses Spring for wiring your code, you'll find it more convenient to use the same Spring for configuring JAX-WS. For example, that would allow your service implementations to receive resource injection via Spring, AOP stuff, logging, etc, etc. This RI extension provides this functionality.

This Spring extension also allows you to configure various aspects of your web service through Spring, such as the use of MTOM, handlers, custom transports, encoding, etc., etc.

Another purpose of this extension is to provide a general purpose mechanism that JAX-WS extension authors can use, to let users use their extensions. For example, when you write a custom transport, custom codec, or custom pipeline assembler, you can use Spring to allow users to configure your extensions.

This deployment mechanism supercedes sun-jaxws.xml and JSR-109 deployment.

Changes / Release Notes

The list of changes can be found in the release notes.


Distributed under dual license consisting of the CDDL v1.0 and GPL v2

Quick Start

Let's consider the most typical case, where you develop a web application and you want to deploy JAX-WS services. First your web.xml needs to have a JAX-WS servlet registered.

  <!-- this is for Spring -->

  <!-- these are for JAX-WS -->
  ... if you deploy more services,
  you might need more <servlet-mapping>s ...

Then you'd be writing something like this in your /WEB-INF/applicationContext.xml:

<beans xmlns="http://www.springframework.org/schema/beans"

  <wss:binding url="/add" service="#addService" />
  <wss:binding url="/sub">
    <wss:service><!-- nested bean is of course fine -->
      <ws:service bean="#myService" />

  <!-- this bean implements web service methods -->
  <bean id="myService" class="foo.MyService" />

  <!-- simplest definition only needs the class name -->
  <ws:service id="addService" impl="foo.MyAddService" handlers="#myHandler"/>

  <bean id="myHandler" class="foo.MyHandler" />


The two wss:binding definitions define what services are exposed to which part of the URL space. In the above code, it deploys two services on two URLs, and one with a handler.

If you know Spring, you should know the "rest", like how to configure your own service beans.

Sample Project

A complete sample application is also available.

Terms of Use; Privacy Policy; Copyright ©2013-2017 (revision 20160708.bf2ac18)
Please Confirm