Skip to main content

SOAP Over JMS using Java EE Service Engine

Posted by mu125243 on April 24, 2006 at 10:46 PM PDT

href="https://glassfish.dev.java.net/javaee5/jbi-se/ServiceEngine.html">Java
EE Service Engine, part of href="https://glassfish.dev.java.net/">GlassFish project, is a href="http://www.jcp.org/en/jsr/detail?id=208">JSR 208
compliant component which along with JMS Binding component from href="https://open-esb.dev.java.net/public/download.html">openESB
can be used to achieve SOAP over JMS.



alt="SOAP over JMS is achieved using Java EE Service Engine and JMS Binding combination"
style="width: 586px; height: 688px;">





In the above diagram one GlassFish instance, Instance 1,  is
acting as a Web Service consumer while the other

(Instance 2) acts as a Web Service Provider.  Following is
configuration details of both the instances



Instance 1 :



Software requirements : GlassFish with mqbroker listening at port 7676,
openESB product

Make sure that JSR 208 compliant components, Java EE Service
Engine  and openESB's JMS Binding are installed

and started.



Deployments :-



1. A web application acting as a web service (CalculatorService)
consumer is deployed on GlassFish with jbi-enabled
flag for the port set to true, so that the outgoing web service request
is routed through Java EE Service Engine.

2. JMS Binding provider deployment for web service deployed on Instance
2



Resources :-

1. Two physical queues - RequestQueue and ResponseQueue are created

2. Administered objects for connecting to the Message Provider with
broker at 7676 for QueueConnectionFactory
and Queue destination are created.





Instance 2 :



Software requirements :

1. GlassFish connecting to instance1's  mq broker listening at
port instance1:7676

2. openESB product



JSR 208 compliant components : Java EE Service Engine  and
openESB's JMS Binding



Deployments :-

1. A web application exposed as a web service - CalculatorService
consumer is deployed on GlassFish . Endpoint for the
CalculatorService is automatically activated in NMR at the time of
deployment of the web app.



2. JMS Binding consumer deployment for the web service



Resources :-

1. Administered objects for connecting to the Message Provider with
broker at instance1:7676 for
QueueConnectionFactory is created.



How does it all work :



A servlet deployed on instance1 invokes a add operation on
CalculatorService deployed on instance2. Since jbi-enabled
flag for the port is set to true, Java EE Service Engine delivers this
web service request to Normalized Message Router (NMR) .
JMS Binding on instance1 which has a provider deployement for
CalculatorService puts the content of the Normalized Message,
a TextMessage, into RequestQueue . JMS Binding on instance 2 is acting
as a consumer for the messages in RequestQueue
and hence picks up the TextMessage from the queue,  bundles it in
a Normalized Message format and delivers it to NMR. 
The normalized message is delivered to Java EE Service Engine on
instance 2 which acts as a provider for CalculatorService .
Java EE Service Engine invokes the endpoint's add operation. Java EE
Service Engine bundles response of add operation in a
normalized message and delivers to NMR. NMR delivers this message to
JMS Binding on instance2 which extracts contents
of the response message and put it in ResponseQueue.  JMS Binding
on instance 1 is listening to messages in ResponseQueue.
Thus, it picks up the response from the queue and delivers it to NMR
which in turn delivers it to Java EE Service Engine and
hence to the servlet which was acting as a consumer.



The entire working scenario described above with executable ant targets
is available at


glassfish/appserv-tests/devtests/webservice/jbi-serviceengine/soapoverjms


Related Topics >>

Comments

Explanation Request

Hi I'm an Italian student. In one of my project this seems to be the best solution that i can achieve. I studied a little bit the example that you mentioned, but I don't understand how i can use such solution in my case. For example wich are the steps to do? Evry time that i try to bind in the casa editor a JMS binding component to the WS nothing happen, and if i import in the CASA the WS and then i try to build the application i obtain several error. Can you land me a hand or point me to some tutorial that explain the example? Thank you.