Welcome!

Microsoft Cloud Authors: Lori MacVittie, Elizabeth White, Yeshim Deniz, Serafima Al, Janakiram MSV

Related Topics: Microsoft Cloud, Java IoT

Microsoft Cloud: Article

Java & .NET: SOAP Over JMS Interoperability

Exposing a Java Web Service via JMS using Apache Axis 1.4 and consuming it from both Java and .NET clients

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

Service Consumer Summary
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);
    }
}


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.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


@ThingsExpo Stories
"Akvelon is a software development company and we also provide consultancy services to folks who are looking to scale or accelerate their engineering roadmaps," explained Jeremiah Mothersell, Marketing Manager at Akvelon, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
IoT is at the core or many Digital Transformation initiatives with the goal of re-inventing a company's business model. We all agree that collecting relevant IoT data will result in massive amounts of data needing to be stored. However, with the rapid development of IoT devices and ongoing business model transformation, we are not able to predict the volume and growth of IoT data. And with the lack of IoT history, traditional methods of IT and infrastructure planning based on the past do not app...
DXWorldEXPO LLC announced today that the upcoming DXWorldEXPO | CloudEXPO New York event will feature 10 companies from Poland to participate at the "Poland Digital Transformation Pavilion" on November 12-13, 2018.
22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
@DevOpsSummit at Cloud Expo, taking place November 12-13 in New York City, NY, is co-located with 22nd international CloudEXPO | first international DXWorldEXPO and will feature technical sessions from a rock star conference faculty and the leading industry players in the world.
More and more brands have jumped on the IoT bandwagon. We have an excess of wearables – activity trackers, smartwatches, smart glasses and sneakers, and more that track seemingly endless datapoints. However, most consumers have no idea what “IoT” means. Creating more wearables that track data shouldn't be the aim of brands; delivering meaningful, tangible relevance to their users should be. We're in a period in which the IoT pendulum is still swinging. Initially, it swung toward "smart for smart...
As data explodes in quantity, importance and from new sources, the need for managing and protecting data residing across physical, virtual, and cloud environments grow with it. Managing data includes protecting it, indexing and classifying it for true, long-term management, compliance and E-Discovery. Commvault can ensure this with a single pane of glass solution – whether in a private cloud, a Service Provider delivered public cloud or a hybrid cloud environment – across the heterogeneous enter...
DXWorldEXPO LLC announced today that ICC-USA, a computer systems integrator and server manufacturing company focused on developing products and product appliances, will exhibit at the 22nd International CloudEXPO | DXWorldEXPO. DXWordEXPO New York 2018, colocated with CloudEXPO New York 2018 will be held November 11-13, 2018, in New York City. ICC is a computer systems integrator and server manufacturing company focused on developing products and product appliances to meet a wide range of ...
Michael Maximilien, better known as max or Dr. Max, is a computer scientist with IBM. At IBM Research Triangle Park, he was a principal engineer for the worldwide industry point-of-sale standard: JavaPOS. At IBM Research, some highlights include pioneering research on semantic Web services, mashups, and cloud computing, and platform-as-a-service. He joined the IBM Cloud Labs in 2014 and works closely with Pivotal Inc., to help make the Cloud Found the best PaaS.
Headquartered in Plainsboro, NJ, Synametrics Technologies has provided IT professionals and computer systems developers since 1997. Based on the success of their initial product offerings (WinSQL and DeltaCopy), the company continues to create and hone innovative products that help its customers get more from their computer applications, databases and infrastructure. To date, over one million users around the world have chosen Synametrics solutions to help power their accelerated business or per...
In an era of historic innovation fueled by unprecedented access to data and technology, the low cost and risk of entering new markets has leveled the playing field for business. Today, any ambitious innovator can easily introduce a new application or product that can reinvent business models and transform the client experience. In their Day 2 Keynote at 19th Cloud Expo, Mercer Rowe, IBM Vice President of Strategic Alliances, and Raejeanne Skillern, Intel Vice President of Data Center Group and ...
Dion Hinchcliffe is an internationally recognized digital expert, bestselling book author, frequent keynote speaker, analyst, futurist, and transformation expert based in Washington, DC. He is currently Chief Strategy Officer at the industry-leading digital strategy and online community solutions firm, 7Summits.
Founded in 2000, Chetu Inc. is a global provider of customized software development solutions and IT staff augmentation services for software technology providers. By providing clients with unparalleled niche technology expertise and industry experience, Chetu has become the premiere long-term, back-end software development partner for start-ups, SMBs, and Fortune 500 companies. Chetu is headquartered in Plantation, Florida, with thirteen offices throughout the U.S. and abroad.
In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, led attendees through the exciting evolution of the cloud. He looked at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering m...
From 2013, NTT Communications has been providing cPaaS service, SkyWay. Its customer’s expectations for leveraging WebRTC technology are not only typical real-time communication use cases such as Web conference, remote education, but also IoT use cases such as remote camera monitoring, smart-glass, and robotic. Because of this, NTT Communications has numerous IoT business use-cases that its customers are developing on top of PaaS. WebRTC will lead IoT businesses to be more innovative and address...
Rodrigo Coutinho is part of OutSystems' founders' team and currently the Head of Product Design. He provides a cross-functional role where he supports Product Management in defining the positioning and direction of the Agile Platform, while at the same time promoting model-based development and new techniques to deliver applications in the cloud.
Business professionals no longer wonder if they'll migrate to the cloud; it's now a matter of when. The cloud environment has proved to be a major force in transitioning to an agile business model that enables quick decisions and fast implementation that solidify customer relationships. And when the cloud is combined with the power of cognitive computing, it drives innovation and transformation that achieves astounding competitive advantage.
IoT is rapidly becoming mainstream as more and more investments are made into the platforms and technology. As this movement continues to expand and gain momentum it creates a massive wall of noise that can be difficult to sift through. Unfortunately, this inevitably makes IoT less approachable for people to get started with and can hamper efforts to integrate this key technology into your own portfolio. There are so many connected products already in place today with many hundreds more on the h...
In his session at Cloud Expo, Alan Winters, U.S. Head of Business Development at MobiDev, presented a success story of an entrepreneur who has both suffered through and benefited from offshore development across multiple businesses: The smart choice, or how to select the right offshore development partner Warning signs, or how to minimize chances of making the wrong choice Collaboration, or how to establish the most effective work processes Budget control, or how to maximize project result...
Personalization has long been the holy grail of marketing. Simply stated, communicate the most relevant offer to the right person and you will increase sales. To achieve this, you must understand the individual. Consequently, digital marketers developed many ways to gather and leverage customer information to deliver targeted experiences. In his session at @ThingsExpo, Lou Casal, Founder and Principal Consultant at Practicala, discussed how the Internet of Things (IoT) has accelerated our abilit...