views:

466

answers:

2

How do you use the the org.springframework.ws.transport.jms.WebServiceMessageDrivenBean class from the Java Spring Framework - Spring-WS project?

There is very little documentation or examples available on the web.

+1  A: 

From what I gather from reading the javadocs it looks like this allows a Spring WebServiceMessageReceiver to be invoked using a JMS client instead of a web services client. Hopefully that's right, because the rest of this is based on that assumption.

The basics of is should match with how you create a regular Spring message driven bean. There is a little bit of documentation on how to do that in the Spring Reference Manual. Also see the AbstractEnterpriseBean Javadoc for some additional information about how the Spring context is retrieved.

The extra configuration required for a WebServiceMessageDrivenBean appear to be a ConnectionFactory, a WebServiceMessageFactory, and your WebServiceMessageReceiver. These need to use the bean names specified in the Javadoc for the WebServiceMessageDrivenBean. The bean names are "connectionFactory", "messageFactory", and "messageReceiver" respectively.

John Meagher
A: 

Using the WebServiceMessageDrivenBean is very similar to the Spring support for Message Driven Beans (MDBS).

First you create a MDB:

public class HelloWorldMessageDrivenBean extends WebServiceMessageDrivenBean {
private static final long serialVersionUID = -2905491432314736668L;
}

That is it as far as the MDB goes!

Next you configure the MDB by adding the following following to the MDB definition in the ejb-jar.xml:



ejb/BeanFactoryPath
java.lang.String

application-context.xml


This tells the Spring MDB support classes where to pick up your Spring configuration file.

You can now configure your endpoints either in the application-context.xml file or in addition using the annotation support.

Keith Lyall