0
votes

I was testing the SOAP over JMS Web Services built with Apache CXF. In particular, I was following the "jms_specs_demo": a WSDL-fist sample describing the consumer required call, the SOAP service implementation and the Queue needed for the message persistence.

The client call is equals to a SOAP over HTTP call (the endpoint is on the WSDL file). However, the JMS JNDI address uses the MQ maker's library (org.apache.activemq.jndi.ActiveMQInitialContextFactory) and it's also required on the client:

<soap:address location="jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616"/>

I have built an independent client for testing it:

JMSGreeterService service = new JMSGreeterService();
JMSGreeterPortType greeter = service.getGreeterPort();

greeter.greetMeOneWay("hello World");

But effectively, this code only works if the ApacheMQ dependency is added:

<dependency>
    <groupId>org.apache.activemq</groupId>
    <artifactId>activemq-broker</artifactId>
    <version>5.13.3</version>
</dependency>

Is there any way to create a SOAP over JMS service without needing to add the MQ maker's library (JAR) on the consumer? I thought JMS API would manage the transport and to push the message into the remote queue without extra libraries.

1

1 Answers

0
votes

In short, No. The JMS API is in and of itself just that - an API that defines the contracts that JMS objects must fulfil. See the javadoc for the JMS API.

To actually use JMS, your client needs to use a concrete implementation of the JMS API (known as the JMS provider), which is what you are doing by using the activemq-broker library.