Welcome!

Microsoft Cloud Authors: Pat Romanski, Liz McMillan, Lori MacVittie, Elizabeth White, Yeshim Deniz

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 .NET Client
In the client, we generate web service proxies exactly the same as if they were HTTP, only we don't necessarily have the option to hit a url that generates/serves a wsdl, so we use a file wsdl. We don't have to do anything special with the proxies. In this example, ShippingService is the service, and GetDistance() is its only operation. It accepts a GetDistanceRequest and returns a GetDistanceResponse. Before we call an operation on our service, we register our protocol to use our ActiveMqWebRequestCreate for a custom URI prefix. Once this protocol is registered, it's available from that point forward within the application domain.

    // Create a dummy URI
    System.Uri urlRequest = new
System.Uri("activeJms://ftp.momentum.com/activeJmsUri/I/do/not/exist.txt");
    // Register it
    bool isGood = WebRequest.RegisterPrefix("activeJms",
    new ActiveMqQueueWebRequest.ActiveMqQueueWebRequestCreate(
    "tcp://localhost:61616", "myQueue", "un", "pw"));

We call our services the same way we would if it were HTTP. The only difference is that the URI uses a different prefix.

    ShippingService.ShippingService svc = new ShippingService.ShippingService();
    svc.Url = "activeJms://localhost:61616";
    ShippingService.GetDistanceRequest req = new ShippingService.GetDistanceRequest();
    req.startZipCode = "78728"; req.endZipCode = "50158";

    ShippingService.GetDistanceResponse resp = svc.GetDistance(req);

In this specific implementation, each prefix has a fixed address and queue. Fancier implementations could support extra information in the URI query string similar to the Tibco one mentioned in the URL-based JMS transport section.

.NET Consumer Summary
The components above can be created once, and then leveraged for any number of services. Once the protocol is registered, we don't have to change the way we work with services, and for all the talk of SOAP, we didn't have to see any! There's nothing to prevent us from using both the JMS and HTTP web service implementations in the same application or integration tests.

Conclusion
We made our service consumers talk directly to the MOM layer. No extra hubs are involved, so the SOAP requests reach the middleware as quickly as possible. With appropriate JMS adapters and knowledge, you can easily implement a consumer in almost any language. Most important, we kept untouched the generated stubs and proxies at the consumer and reused the service engine on the server side. So in addition to the highly scalable and reliable, this approach is also fast and easy to implement.

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.


IoT & Smart Cities Stories
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...
If a machine can invent, does this mean the end of the patent system as we know it? The patent system, both in the US and Europe, allows companies to protect their inventions and helps foster innovation. However, Artificial Intelligence (AI) could be set to disrupt the patent system as we know it. This talk will examine how AI may change the patent landscape in the years to come. Furthermore, ways in which companies can best protect their AI related inventions will be examined from both a US and...
Poor data quality and analytics drive down business value. In fact, Gartner estimated that the average financial impact of poor data quality on organizations is $9.7 million per year. But bad data is much more than a cost center. By eroding trust in information, analytics and the business decisions based on these, it is a serious impediment to digital transformation.
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...
DXWorldEXPO LLC, the producer of the world's most influential technology conferences and trade shows has announced the 22nd International CloudEXPO | DXWorldEXPO "Early Bird Registration" is now open. Register for Full Conference "Gold Pass" ▸ Here (Expo Hall ▸ Here)
@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. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time t...
CloudEXPO New York 2018, colocated with DXWorldEXPO 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.
The best way to leverage your Cloud Expo presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering Cloud Expo and @ThingsExpo will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at Cloud Expo. Product announcements during our show provide your company with the most reach through our targeted audiences.
Machine Learning helps make complex systems more efficient. By applying advanced Machine Learning techniques such as Cognitive Fingerprinting, wind project operators can utilize these tools to learn from collected data, detect regular patterns, and optimize their own operations. In his session at 18th Cloud Expo, Stuart Gillen, Director of Business Development at SparkCognition, discussed how research has demonstrated the value of Machine Learning in delivering next generation analytics to impr...
The challenges of aggregating data from consumer-oriented devices, such as wearable technologies and smart thermostats, are fairly well-understood. However, there are a new set of challenges for IoT devices that generate megabytes or gigabytes of data per second. Certainly, the infrastructure will have to change, as those volumes of data will likely overwhelm the available bandwidth for aggregating the data into a central repository. Ochandarena discusses a whole new way to think about your next...