| By Stanimir Stanev, Rob Bartlett | Article Rating: |
|
| March 29, 2008 04:00 PM EDT | Reads: |
14,529 |
client-config.wsdd
The client-config.wsdd
is used by the Axis client engine to specify the handler responsible
for sending the message to the ultimate receiver. The following
deployment descriptor replaces the default HTTPSender handler with the
JMSSender handler that uses JMS to transport SOAP messages.
<?xml version="1.0" encoding="UTF-8"?>
<deployment
xmlns=HYPERLINK "http://xml.apache.org/axis/wsdd/"http://xml.apache.org/axis/wsdd/
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<handler name="JMSSender"
type="java:org.apache.axis.transport.jms.JMSSender" />
<transport name="JMSTransport" pivot="JMSSender"/>
</deployment>
URL-based JMS Transport
The JMS URL syntax provides a vendor-neutral way of specifying JMS specific details like Topic and Queue destinations.
The query part of the service provider endpoint URL (the part after the question mark) is treated by Axis as key/value pairs and they are provided to the JMS vendor adapter factory to instantiate a specific adapter. The default JMS adapter in Apache Axis is JNDI, so if the vendor=JNDI isn't specified in the URL then the default org.apache.axis.components.jms.JNDIVendorAdapter will be used to locate the JMS connection factory and destinations. You can write your own adapter, just make sure it's available in the CLASSPATH and specified by the vendor property like vendor=com.momentumsi.jms.adapters.MyOwnAdapter.
If your JMS provider happens to be Tibco's EMS then a sample URL may look like this:
jms://tibjms/queue?java.naming.provider.url=tcp://localhost:7222&java.naming.factory.initial=com.tibco.timjms.naming.
TibjmsInitialContextFactory&ConnectionFactoryJNDIName=QueueConnectionFactory&Destination=queue.test
Before making the actual call, the Consumer must change the service provider endpoint to the JMS one as shown in the example below:
...
String jmsUrl = "jms://...";
shippingService._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY, jmsUrl);
...
GetDistanceResponse response = shippingService.getDistance(request);
Axis JMS Sender
The JMSSender handler is
provided by Axis. It takes the properties from the message context that
were parsed and prepared by the JMSTransport and does the actual work:
- Create JMS connection
- Create temporary JMS response destination
- Send the location of the temporary JMS destination together with the actual SOAP request to the specified JMS request destination
- Receive the SOAP response from the temporary JMS response destination
- Provide the SOAP response to the Axis Client Engine to be delivered to the consumer
We were able to reuse the unchanged code that was generated by WSDL2Java. We registered a transport implementation that handles jms:// URLs and we changed the endpoint URL to jms:// where we specified JNDI properties like JMS connection factory and destination. We provided a custom client-config.wsdd to the Axis Client Engine, where we specified an Axis-provided JMS handler that does the actual send and receive of SOAP requests and responses.
MOM (Message-Oriented Middleware)
As described
above, the MOM layer increases interoperability, portability, and
flexibility. It has no knowledge of the consumers or message provider
and just does what it does best: serve as a backbone for an Event
Driven Architecture.
MOM could be any available JMS provider like ActiveMQ, JBoss Messaging, Open JMS, Oracle AQ, Tibco EMS, WebSphere MQ, or for advanced processing, any available ESB provider like Apache ServiceMix, Tibco BusinessWorks, Sonic ESB, or OpenESB.
Service Provider Side
Service Provider JMSReceiver
Although Axis
provides a simple org.apache.axis.transport.jms.SimpleJMSListener
receiver, it's not intended for production. It's for testing and
debugging purposes. So we have to write our own.
Our ShippingJMSReceiver is a standard JMS listener that extends javax.jms.MessageListener. Its basic purpose is to listen asynchronously for messages and then pass them off to our MessageProcessor. It can be deployed as a MDB (Message Driven Bean) to any application server, or even configured via Jencks to deploy inside Spring and provide a Message-Driven POJO.
public class ShippingJMSReceiver implements MessageListener
{
public void onMessage(javax.jms.Message message)
{
BytesMessage bytesMessage = (BytesMessage) message;
MessageProcessor msgProcessor = new MessageProcessor();
msgProcessor.processMessageAsSoapRequest(getAxisEngine(), bytesMessage);
}
private AxisEngine getAxisEngine() throws Exception
{
FileProvider fileProvider = new FileProvider("deploy-shipping.wsdd");
return new AxisServer(fileProvider);
}
}
Published March 29, 2008 Reads 14,529
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Stanimir Stanev
Stanimir Stanev is a senior consultant at MomentumSI's Enterprise Architecture Solutions practice. He has many years of experience focusing on providing enterprise architecture and strategy expertise to companies looking to migrate to or maximize the advantages of SOA principles.
More Stories By Rob Bartlett
Rob Bartlett is a senior consultant at MomentumSI's Software Development Solutions practice. He has over a decade of experience in technical roles, guiding major corporations in the design, implementation, and integration of business solutions.
![]() |
sjsu 04/23/08 07:52:59 PM EDT | |||
good job man....... really good idea |
||||
- The Top 150 Players in Cloud Computing
- Commercial vs Federal Cloud Computing
- Why IBM’s Server Chief Got Busted
- Industry Experts Discuss the State of Cloud Computing
- Cloud Expo New York Call for Papers Now Open
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- US Federal Government is Major Cloud Computing Innovator
- Google Wave
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Adaptivity & Cloud Computing: Exclusive Q&A with CEO Tony Bishop
- 4th International Cloud Expo: Photo Album
- The Top 150 Players in Cloud Computing
- SYS-CON.TV: Cloud Computing Expo Power Panel
- Commercial vs Federal Cloud Computing
- Why IBM’s Server Chief Got Busted
- 1st Annual GovIT Expo: Letter from the Technical Chair
- Industry Experts Discuss the State of Cloud Computing
- Deputy CIO of the CIA to Keynote 1st Annual GovIT Expo
- SOA World Power Panel on SYS-CON.TV
- CIA was Headed to an Enterprise Cloud All Along: Jill Tummler Singer
- Cloud Expo New York Call for Papers Now Open
- 1st Annual Government IT Conference & Expo: Themes & Topics
- Stock in Focus: Dragon Capital
- The i-Technology Right Stuff
- Who Are The All-Time Heroes of i-Technology?
- Get the Message
- Where Are RIA Technologies Headed in 2008?
- i-Technology Viewpoint: Is Web 2.0 the Global SOA?
- i-Technology Viewpoint: Thinking Outside the VC Box
- ESB Myth Busters: 10 Enterprise Service Bus Myths Debunked
- i-Technology Viewpoint: When to Leave Your First IT Job
- SOA Web Services Edge Conference Coverage on SYS-CON.TV
- Five Reasons Why Web 2.0 Matters
- SYS-CON.TV's "SOA Web Services" and "Enterprise Open Source" Programs To Air in December
- SOA World Conference & Expo SYS-CON.TV Power Panel Live From Times Square










Cloud computing is a game changer. The cloud ...























