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

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"?>
xmlns=HYPERLINK "http://xml.apache.org/axis/wsdd/"http://xml.apache.org/axis/wsdd/
<handler name="JMSSender"
type="java:org.apache.axis.transport.jms.JMSSender" />
<transport name="JMSTransport" pivot="JMSSender"/>

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:


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.

Latest Stories
Daniel Jones is CTO of EngineerBetter, helping enterprises deliver value faster. Previously he was an IT consultant, indie video games developer, head of web development in the finance sector, and an award-winning martial artist. Continuous Delivery makes it possible to exploit findings of cognitive psychology and neuroscience to increase the productivity and happiness of our teams.
As DevOps methodologies expand their reach across the enterprise, organizations face the daunting challenge of adapting related cloud strategies to ensure optimal alignment, from managing complexity to ensuring proper governance. How can culture, automation, legacy apps and even budget be reexamined to enable this ongoing shift within the modern software factory? In her Day 2 Keynote at @DevOpsSummit at 21st Cloud Expo, Aruna Ravichandran, VP, DevOps Solutions Marketing, CA Technologies, was jo...
Predicting the future has never been more challenging - not because of the lack of data but because of the flood of ungoverned and risk laden information. Microsoft states that 2.5 exabytes of data are created every day. Expectations and reliance on data are being pushed to the limits, as demands around hybrid options continue to grow.
The standardization of container runtimes and images has sparked the creation of an almost overwhelming number of new open source projects that build on and otherwise work with these specifications. Of course, there's Kubernetes, which orchestrates and manages collections of containers. It was one of the first and best-known examples of projects that make containers truly useful for production use. However, more recently, the container ecosystem has truly exploded. A service mesh like Istio addr...
Digital Transformation: Preparing Cloud & IoT Security for the Age of Artificial Intelligence. As automation and artificial intelligence (AI) power solution development and delivery, many businesses need to build backend cloud capabilities. Well-poised organizations, marketing smart devices with AI and BlockChain capabilities prepare to refine compliance and regulatory capabilities in 2018. Volumes of health, financial, technical and privacy data, along with tightening compliance requirements by...
As IoT continues to increase momentum, so does the associated risk. Secure Device Lifecycle Management (DLM) is ranked as one of the most important technology areas of IoT. Driving this trend is the realization that secure support for IoT devices provides companies the ability to deliver high-quality, reliable, secure offerings faster, create new revenue streams, and reduce support costs, all while building a competitive advantage in their markets. In this session, we will use customer use cases...
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.
Evan Kirstel is an internationally recognized thought leader and social media influencer in IoT (#1 in 2017), Cloud, Data Security (2016), Health Tech (#9 in 2017), Digital Health (#6 in 2016), B2B Marketing (#5 in 2015), AI, Smart Home, Digital (2017), IIoT (#1 in 2017) and Telecom/Wireless/5G. His connections are a "Who's Who" in these technologies, He is in the top 10 most mentioned/re-tweeted by CMOs and CIOs (2016) and have been recently named 5th most influential B2B marketeer in the US. H...
DevOpsSummit New York 2018, colocated with CloudEXPO | DXWorldEXPO New York 2018 will be held November 11-13, 2018, in New York City. Digital Transformation (DX) is a major focus with the introduction of DXWorldEXPO within the program. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of bus...
With 10 simultaneous tracks, keynotes, general sessions and targeted breakout classes, @CloudEXPO and DXWorldEXPO are two of the most important technology events of the year. Since its launch over eight years ago, @CloudEXPO and DXWorldEXPO have presented a rock star faculty as well as showcased hundreds of sponsors and exhibitors! In this blog post, we provide 7 tips on how, as part of our world-class faculty, you can deliver one of the most popular sessions at our events. But before reading...
DXWordEXPO New York 2018, colocated with CloudEXPO New York 2018 will be held November 11-13, 2018, in New York City and will bring together Cloud Computing, FinTech and Blockchain, Digital Transformation, Big Data, Internet of Things, DevOps, AI, Machine Learning and WebRTC to one location.
DXWorldEXPO LLC announced today that ICOHOLDER named "Media Sponsor" of Miami Blockchain Event by FinTechEXPO. ICOHOLDER give you detailed information and help the community to invest in the trusty projects. Miami Blockchain Event by FinTechEXPO has opened its Call for Papers. The two-day event will present 20 top Blockchain experts. All speaking inquiries which covers the following information can be submitted by email to [email protected] Miami Blockchain Event by FinTechEXPO also offers s...
DXWorldEXPO | CloudEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
@DevOpsSummit New York 2018, colocated with CloudEXPO | DXWorldEXPO New York 2018 will be held November 11-13, 2018, in New York City. From showcase success stories from early adopters and web-scale businesses, DevOps is expanding to organizations of all sizes, including the world's largest enterprises - and delivering real results.
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.