Welcome!

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

After the message is received, in the code above, the logic instantiates the standard AxisEngine, passes the deploy-shipping.wsdd to it, and invokes the MessageProcessor. Again, the name and location of the hard-coded deploy-shipping.wsdd file should be externalized to allow changes without code recompilation and redeployment.

The MessageProcessor works with a single SOAP request. It uses the AxisEngine to invoke the appropriate service operation. The beauty of this approach is that it reuses the AxisEngine that handles the SOAP messages without knowing how they were delivered. It's transport-independent.

...
Message soapMessage = new Message(bytesMessageReader);
MessageContext msgContext = new MessageContext(axisEngine);
msgContext.setRequestMessage(soapMessage);
axisEngine.invoke(msgContext);
soapMessage = msgContext.getResponseMessage();
...

The SOAP response is sent back to the JMS destination provided by the JMSSender from the consumer side.

...
Destination responseDestination = bytesMessage.getJMSReplyTo();
if (responseDestination != null)
{
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    soapMessage.writeTo(out);
    JMSUtil.sendJmsMessage(responseDestination, out.toByteArray());
}
...

For simplicity's sake, we don't show any reasonable exception handlers or provide the code available in JMSUtil that contains the standard Java to-send JMS message to the specified destination.

Axis Server Engine
The Axis Server Engine is provided by Axis. As we mentioned, it has no knowledge of how the SOAP message was delivered. It just takes it and processes it, which will actually result in an invocation of the actual GetDistance operation of our ShippingService.

So how does AxisEngine find the ShippingService? Well, the deploy-shipping.wsdd provided to the AxisEngine is a standard Axis deployment descriptor. It describes handlers, services, operations, mappings, classes, and everything that Axis needs to find and invoke the operation as a regular Java method.

Shipping Service
We write the shipping service. It contains the actual business logic of the exposed service operations.

public class ShippingWebService
{
    public GetDistanceResponse getDistance(GetDistanceRequest request)
throws Exception
    {
       ...
    }
}

As a regular Axis Web Service, the shipping Web Service requires the deploy-shipping.wsdd that we use to deploy the service under Axis. To learn more about how to write WSDD files, see the Apache Axis documentation.

Service Provider Summary
The only component that we've added to handle SOAP messages is the JMSReceiver. It's plugged into the architecture to handle messages delivered through JMS. The rest of the components are exactly the same since they expose standard SOAP over HTTP services. That's why this architecture can handle requests delivered by both JMS and HTTP at the same time. Besides these two, by implementing appropriate receivers, the service provider can be extended to handle messages delivered by any transport.

The .NET Consumer of JMS
SOAP over HTTP is easy to consume from a .NET application. Visual Studio 2005 or WSDL.exe will automatically generate proxies based on a wsdl, so developers can get down to the business logic rather than worry about the plumbing. That's not to say it's as easy as pie. Not all SOAP is created equal, but addressing the issues around SOAP compatibilities would warrant an entire article (or several). Here we're focused on how to use the .NET infrastructure to consume Java SOAP services over JMS. Our examples were created for .NET 2.0 using Visual Studio 2005 and they assume a general understanding of how to generate HTTP Web Service proxies. (Figure 2)


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
SAP is the world leader in enterprise applications in terms of software and software-related service revenue. Based on market capitalization, we are the world's third largest independent software manufacturer. Harness the power of your data and accelerate trusted outcome-driven innovation by developing intelligent and live solutions for real-time decisions and actions on a single data copy. Support next-generation transactional and analytical processing with a broad set of advanced analytics - r...
DXWorldEXPO LLC announced today that Kevin Jackson joined the faculty of CloudEXPO's "10-Year Anniversary Event" which will take place on November 11-13, 2018 in New York City. Kevin L. Jackson is a globally recognized cloud computing expert and Founder/Author of the award winning "Cloud Musings" blog. Mr. Jackson has also been recognized as a "Top 100 Cybersecurity Influencer and Brand" by Onalytica (2015), a Huffington Post "Top 100 Cloud Computing Experts on Twitter" (2013) and a "Top 50 C...
Provide an overview of the capabilities of Azure Stack allowing you or your customers to adopt truly consistent Hybrid Cloud capabilities to deliver greater productivity in your cloud world. Ultan Kinahan is on a member of the Global Black Belt team at Microsoft with a focus on Azure Stack Hybrid Cloud. Ultan has been in the Azure team since the beginning, Has held roles in Engineering, Sales and now consults with both small to medium size business and the worlds largest organizations on how to ...
As the fourth industrial revolution continues to march forward, key questions remain related to the protection of software, cloud, AI, and automation intellectual property. Recent developments in Supreme Court and lower court case law will be reviewed to explain the intricacies of what inventions are eligible for patent protection, how copyright law may be used to protect application programming interfaces (APIs), and the extent to which trademark and trade secret law may have expanded relev...
Early Bird Registration Discount Expires on August 31, 2018 Conference Registration Link ▸ HERE. Pick from all 200 sessions in all 10 tracks, plus 22 Keynotes & General Sessions! Lunch is served two days. EXPIRES AUGUST 31, 2018. Ticket prices: ($1,295-Aug 31) ($1,495-Oct 31) ($1,995-Nov 12) ($2,500-Walk-in)
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 Ethereal. Andrew's role at ConsenSys Enterprise is a mul...
Contino is a global technical consultancy that helps highly-regulated enterprises transform faster, modernizing their way of working through DevOps and cloud computing. They focus on building capability and assisting our clients to in-source strategic technology capability so they get to market quickly and build their own innovation engine.
Blockchain is a new buzzword that promises to revolutionize the way we manage data. If the data is stored in a blockchain there is no need for a middleman - the distributed database is stored on multiple and there is no need to have a centralized server that will ensure that the transactions can be trusted. The best way to understand how a blockchain works is to build one. During this presentation, we'll start with covering the basics (hash, nounce, block, smart contracts) and then we'll create ...
DevOpsSUMMIT at CloudEXPO will expand the DevOps community, enable a wide sharing of knowledge, and educate delegates and technology providers alike. Recent research has shown that DevOps dramatically reduces development time, the amount of enterprise IT professionals put out fires, and support time generally. Time spent on infrastructure development is significantly increased, and DevOps practitioners report more software releases and higher quality. Sponsors of DevOpsSUMMIT at CloudEXPO will b...
FinTech Is Now Part of the CloudEXPO New York Program. Financial enterprises in New York City, London, Singapore, and other world financial capitals are embracing a new generation of smart, automated FinTech that eliminates many cumbersome, slow, and expensive intermediate processes from their businesses. Accordingly, attendees at the upcoming 22nd CloudEXPO | DXWorldEXPO November 12-13, 2018 in New York City will find fresh new content in two new tracks called: FinTechEXPO New York Blockchain E...
In addition to 22 Keynotes and General Sessions, pick from 40 technical sessions in two tracks: (1) DevOpsSUMMIT (2) Cloud-Native & Serverless. EXPIRES AUGUST 31, 2018. Ticket prices: ($295-Aug 31) ($395-Oct 31) ($495-Nov 12) ($595-Walk-in) Does NOT include lunch. DevOps Institue Certification DevOps Institute Two-Day DevOps Certification Program EXPIRES AUGUST 31, 2018. Ticket prices: ($995-Aug 31) ($1,095-Oct 31) ($1,195-Nov 12) ($1,395-Walk-in)
Cloud adoption is a core component of digital transformation. Scaling the IT environment, making it resilient, and reducing costs are what organizations want. Hear from the author of the best selling Packtbook "Architecting Cloud Computing Solutions" as he presents and explains critical Cloud solution design considerations and technology decisions required to choose and deploy the right Cloud service and deployment models, that are aligned to your business and technology service requirements. T...
Wasabi is the hot cloud storage company delivering low-cost, fast, and reliable cloud storage. Wasabi is 80% cheaper and 6x faster than Amazon S3, with 100% data immutability protection and no data egress fees. Created by Carbonite co-founders and cloud storage pioneers David Friend and Jeff Flowers, Wasabi is on a mission to commoditize the storage industry. Wasabi is a privately held company based in Boston, MA. Follow and connect with Wasabi on Twitter, Facebook, Instagram and the Wasabi blog...
Today we introduced our New York & Silicon Valley combo sponsorship and exhibit opportunities with unmatched pre and post-show promotion. At CloudEXPO | DevOpsSUMMIT | DXWorldEXPO NY & CA, 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...
Addteq is a leader in providing business solutions to Enterprise clients. Addteq has been in the business for more than 10 years. Through the use of DevOps automation, Addteq strives on creating innovative solutions to solve business processes. Clients depend on Addteq to modernize the software delivery process by providing Atlassian solutions, create custom add-ons, conduct training, offer hosting, perform DevOps services, and provide overall support services.