SYS-CON MEDIA Authors: Elizabeth White, Yeshim Deniz, Carmen Gonzalez, Pat Romanski, Gary Arora

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

We build layers and layers, and as they help isolate different components, they impact performance and require additional managing. We can imagine a world of services after years of development, where to reach the very back end of business logic, a message flies through so many hubs that becomes impossible to attain reasonable SLAs anymore.

Why don't we eliminate the extra hubs when we can? How about if we reach the services directly through JMS? True, this may not be very appropriate for services exposed on the Internet, but it's probably more likely and preferable to do it in an organization where architectures like EDA (Event Driven Architecture) are implemented to help the production, detection, consumption of, and reaction to events.

We're going to show how to expose a Java Web Service via JMS using Apache Axis 1.4 and consume it from both Java and .NET clients by reusing the generated stubs and proxies and just changing the transport.

Java Service Consumer + MOM + Java Service Provider
As shown in Figure 1, our service consumer side consists of components that are both written by us (represented by the blue boxes) and those that are provided by Axis (represented by the white boxes). The picture on the service provider side is similar. In the middle, we have MOM (Message-Oriented Middleware), which increases the interoperability, portability, and flexibility of an application by letting it be distributed over multiple heterogeneous platforms. MOM reduces the complexity of developing applications that span multiple operating systems and network protocols by insulating developers from the details of the various operating systems and network interfaces.

Sample Service
Our sample Shipping Service has a GetDistance operation that accepts two ZIP codes and returns the distance between the two locations in miles.

To understand the roles and functionality of each component better, let's go through them.

Service Consumer Side
Consumer
The consumer is code we write. It uses generated-by-WSDL2Java stubs and proxies to instantiate the service request, populate it with request values, and provide it to the Axis client engine for transportation to the service endpoint.

The default transportation mechanism that Axis uses is the commonly accepted HTTP one and obviously it works with service endpoints that are specified by their http locations like HYPERLINK "http://momentumsi.com/service/shipping".

In our case, we want Axis to use JMS as a transport of our payload. We're looking for a way to reuse the generated-by-WSDL2Java code and just instruct Axis to deliver the payload via JMS instead of HTTP.

Fortunately, Axis provides a way to register different transports that should be used for the service endpoint URLs of the specified protocol. For example, we can register the provided-by-Axis org.apache.axis.transport.jms.JMSTransport to serve endpoint URLs that are specified by jms:// protocol like this:

import org.apache.axis.client.Call;
import org.apache.axis.transport.jms.JMSTransport;
...
Call.setTransportForProtocol("jms", JMSTransport.class);

The JMSTransport is responsible for parsing the transport-specific properties provided in the endpoint URL and setting them up in the message context. Later we'll explain how JMSSender handler takes those properties and does the actual JMS work.

Generated Proxy
The Generated Proxy is generated by the provided-by-Axis WSDL2Java utility. This component is used by the consumers to do both SOAP-over-HTTP and JMS calls. Even better, the component can be reused from any other registered transport implementation that we can come up in our architecture.

Axis Client Engine
The Axis Client Engine is provided by Axis. It can be configured with WSDD files that are written by us and provided to the engine via the generated proxy.

What is a WSDD file? A Web Service is deployed into Axis using an XML-based deployment descriptor file known as a Web Service Deployment Descriptor (WSDD). WSDD describes how the various components installed in Axis are to be chained together to process incoming and outgoing messages to the service. The WSDD can be used both on the client and server sides.

For our shipping service, here's an example of how to provide the client WSDD to the Axis client engine and then just invoke the GetDistance service operation:

import org.apache.axis.configuration.FileProvider;
...
EngineConfiguration engineConfig = new FileProvider("client-config.wsdd");
ShippingServiceLocator shippingServiceLocator = new ShippingServiceLocator(engineConfig);
ShippingSoapBindingStub shippingService = (ShippingSoapBindingStub)shippingServiceLocator.getShipping();
...
GetDistanceResponse response = shippingService.getDistance(request);

Notice that in this example the name and location of client-config.wsdd is hard-coded in the source code, but for production, you should change it so it's externalized and provided as a property, injected via the Spring framework or other mechanism.


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
In a recent survey, Sumo Logic surveyed 1,500 customers who employ cloud services such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). According to the survey, a quarter of the respondents have already deployed Docker containers and nearly as many (23 percent) are employing the AWS Lambda serverless computing framework. It's clear: serverless is here to stay. The adoption does come with some needed changes, within both application development and operations. Th...
Isomorphic Software is the global leader in high-end, web-based business applications. We develop, market, and support the SmartClient & Smart GWT HTML5/Ajax platform, combining the productivity and performance of traditional desktop software with the simplicity and reach of the open web. With staff in 10 timezones, Isomorphic provides a global network of services related to our technology, with offerings ranging from turnkey application development to SLA-backed enterprise support. Leadin...
Most modern computer languages embed a lot of metadata in their application. We show how this goldmine of data from a runtime environment like production or staging can be used to increase profits. Adi conceptualized the Crosscode platform after spending over 25 years working for large enterprise companies like HP, Cisco, IBM, UHG and personally experiencing the challenges that prevent companies from quickly making changes to their technology, due to the complexity of their enterprise. An accomp...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. 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 business. Only 12% still survive. Similar percentages are found throug...
Every organization is facing their own Digital Transformation as they attempt to stay ahead of the competition, or worse, just keep up. Each new opportunity, whether embracing machine learning, IoT, or a cloud migration, seems to bring new development, deployment, and management models. The results are more diverse and federated computing models than any time in our history.
Andrew Keys is co-founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereum.
The dream is universal: heuristic driven, global business operations without interruption so that nobody has to wake up at 4am to solve a problem. Building upon Nutanix Acropolis software defined storage, virtualization, and networking platform, Mark will demonstrate business lifecycle automation with freedom of choice and consumption models. Hybrid cloud applications and operations are controllable by the Nutanix Prism control plane with Calm automation, which can weave together the following: ...
Moving to Azure is the path to digital transformation, but not every journey is effective. Organizations that start with a cohesive, well-planned migration strategy can avoid common mistakes and stay a step ahead of the competition. Learn from Atmosera CEO, Jon Thomsen about the opportunities and challenges found in three pivotal phases of the journey to the cloud: Evaluation and Architecting, Migration and Management, and Optimization & Innovation. In each phase, there are distinct insights tha...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. 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 business. Only 12% still survive. Similar percentages are found throug...
Intel is an American multinational corporation and technology company headquartered in Santa Clara, California, in the Silicon Valley. It is the world's second largest and second highest valued semiconductor chip maker based on revenue after being overtaken by Samsung, and is the inventor of the x86 series of microprocessors, the processors found in most personal computers (PCs). Intel supplies processors for computer system manufacturers such as Apple, Lenovo, HP, and Dell. Intel also manufactu...
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science" is responsible for guiding the technology strategy within Hitachi Vantara for IoT and Analytics. Bill brings a balanced business-technology approach that focuses on business outcomes to drive data, analytics and technology decisions that underpin an organization's digital transformation strategy. Bill has a very impressive background which includes ...
Darktrace is the world's leading AI company for cyber security. Created by mathematicians from the University of Cambridge, Darktrace's Enterprise Immune System is the first non-consumer application of machine learning to work at scale, across all network types, from physical, virtualized, and cloud, through to IoT and industrial control systems. Installed as a self-configuring cyber defense platform, Darktrace continuously learns what is ‘normal' for all devices and users, updating its understa...
While a hybrid cloud can ease that transition, designing and deploy that hybrid cloud still offers challenges for organizations concerned about lack of available cloud skillsets within their organization. Managed service providers offer a unique opportunity to fill those gaps and get organizations of all sizes on a hybrid cloud that meets their comfort level, while delivering enhanced benefits for cost, efficiency, agility, mobility, and elasticity.
On-premise or off, you have powerful tools available to maximize the value of your infrastructure and you demand more visibility and operational control. Fortunately, data center management tools keep a vigil on memory contestation, power, thermal consumption, server health, and utilization, allowing better control no matter your cloud's shape. In this session, learn how Intel software tools enable real-time monitoring and precise management to lower operational costs and optimize infrastructure...
Most organizations are awash today in data and IT systems, yet they're still struggling mightily to use these invaluable assets to meet the rising demand for new digital solutions and customer experiences that drive innovation and growth. What's lacking are potent and effective ways to rapidly combine together on-premises IT and the numerous commercial clouds that the average organization has in place today into effective new business solutions. New research shows that delivering on multicloud e...