Posted by kohsuke
on January 4, 2007 at 11:47 AM PST
The first cut of the Spring support in the JAX-WS RI is ready. If you are already using Spring to configure your applications, you would like this, too.
Various people have been asking us to do a better job at Spring integration. So I've been working on it, and the first cut is ready.
The idea behind this is relatively simple. Spring is widely used to configure server applications nowadays. It makes it easy to have your object reference your other objects. Thus when you are using Spring in your application, you usually want your web service implementation classes to be configured by Spring, because those classes need access to other objects in your application. The same goes to handlers, if you have any.
With the Spring support extension in the JAX-WS RI, you can now wire your service implementation classes as well as handlers by using Spring, like this:
This example configures one service MyService with one handler MyHandler, then expose it to /stockQuote. Those two user classes are now wired by Spring, so you can have other dependencies injected to them in the same way you'd configure other beans in Spring.
Not only that, this extension allows you to configure JAX-WS itself from Spring. For example, by writing you can make this service SOAP 1.2 service. Or to enable addressing, you can do:
So as you can see, this can effectively replace sun-jaxws.xml. Since Spring support is open-ended, this can be used to enable other JAX-WS extensions. So for example we can use this to configure JMS transport, or to configure JSON encoding, etc.
This is still a work in progress, but since I'm new to Spring, I thought I'd make this available sooner so that people with more Spring experience can give me feedback.
If you're interested in using this (and I hope you are!), all the necessary jar files are available at java.net maven2 repository . A sample application is available at here , and the project website is available here .