Comments
yourfanat wrote: I am using another tool for Oracle developers - dbForge Studio for Oracle. This IDE has lots of usefull features, among them: oracle designer, code competion and formatter, query builder, debugger, profiler, erxport/import, reports and many others. The latest version supports Oracle 12C. More information here.
Cloud Computing
Conference & Expo
November 2-4, 2009 NYC
Register Today and SAVE !..

2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
In many cases, the end of the year gives you time to step back and take stock of the last 12 months. This is when many of us take a hard look at what worked and what did not, complete performance reviews, and formulate plans for the coming year. For me, it is all of those things plus a time when I u...
SYS-CON.TV
The Unreliable Internet
When you need reliable messaging and how to use it

Sandesha + Axis2
If you’re familiar with WSO2 WSAS, you might know about its SOAP implementation. It uses Apache Axis2 to implement the SOAP specification. This leads to a natural choice for its WSRM implementation: Apache Sandesha2. Sandesha was built to work with Axis2. It’s implemented as an Axis2 module.

Axis2 provides a great pluggable architecture that lets you add modules that implement extra behavior on top of SOAP. In the case of Sandesha, extra metadata and processing is done at the exit of outbound messages and at the entrance of inbound messages. This lets Sandesha implement the WSRM specification transparently to the rest of the Axis2 stack and thus transparently to the clients and servers that rely on the Axis2 stack to send or receive SOAP messages.

Besides being a full implementation of WSRM and specifically designed for Axis2, Sandesha has an impressive feature list. It has a pluggable persistence mechanism (see the section on Persistence). It provides a listener mechanism to allow customized logic to handle events such as when a sequence times out. It has a powerful reporting feature that gives you instant information on the Sandesha subsystem and any ongoing deliver sequences. Its configuration from both the server and client perspective is a snap. Let’s take a look at how you’d configure both Web Services and Web Service clients to use WSRM with WSO2 WSAS.

Configuring a Service for WSRM
Let’s take a Web Service and enable WSRM for it. This will let clients send it messages that take advantage of WSRM. Now one of the key aspects of WSRM is that this has to be transparent to your service. You don’t have to change any of the code for your service to enable WSRM. As it turns out, there are a couple of ways to do this.

The first way to enable WSRM uses Axis2’s Web Service descriptor. This is the services.xml for your Web Service. An example of a WSRM-enabled Web Service descriptor is shown in Listing 2.

Most of this is just normal Axis2 elements and configuration options. The only thing we did to enable WSRM was to add the sandesha2 module. We didn’t have to do anything else.

That’s pretty easy, but WSO2 WSAS makes it even easier. WSAS’s Management Console is a powerful graphical interface for managing Web Services. You can use it to enable WSRM for any Web Service. Just log in and go to Services -> <Your Service> -> Manage Module Engagements. You can then select sandesha2 as shown in Figure 3.

After you select sandesha2 and click the Engage button, the UI will be refreshed to show that sandesha2 has been engaged and so WSRM has been enabled, as shown in Figure 4.

With just a few clicks we enabled WSRM on any Web Service deployed on WSO2 WSAS. Now let’s take a look at creating a Web Service client that will use WSRM to send reliable messages to a WSRM-enabled Web Service.

Configuring a Client for WSRM
Enabling WSRM for a Web Service running on WSO2 WSAS was very easy. It’s not much harder to enable it on the client as well. Let’s take a look at the code for doing this in Listing 3.

This code is just like any other Axis2 client code you would write, but with a couple of notable exceptions. The class org.apache.axis2.client.Options let’s us set Axis2 options on our org.apache.axis2.client.ServiceClient instance that we use to send SOAP messages to the WSRM-enabled Web Service. We use this class to enable WSRM by using the engageModule API. That’s all it takes on the client to enable WSRM.

There’s one other thing you might notice in Listing 3. In the code, two messages are sent. After the first one is sent, we add another option. This is the “last message” option that tells Sandesha to add this metadata to the SOAP header on our message, as seen in Listing 1.

WSAS Extensions to WSRM: Persistence
The WSRM specification is what is known as a wire-only specification. This means that it only specifies the behavior of messages being sent. It doesn’t specify how clients and servers should deal with messages before they’re sent or after they’re received. The network itself is a major cause of unreliable messaging, but the clients and servers can also be the cause.

WSAS contains an extension to WSRM, adding persistence to messages. There are two kinds of persistence or storage. The default is in-memory storage. This is just what it sounds like. A WSAS service will keep track of which messages have been received, along with acknowledgments, etc., in memory. This is very fast, but obviously there could be problems in case of a crash. An acknowledgment might not be sent out, for instance. An alternative is permanent storage, which is typically storage in a database. This allows for the recovery of state after a crash.

How do you configure storage? Luckily the WS-Policy standard is made for extensibility, so it can be leveraged to add things like storage. Listing 4 shows a policy specifying the in-memory and permanent StorageManagers.

Of course you can use different StorageManager implementations rather than the default ones shown here. To enable permanent storage on your Web Service, simply add a line of XML to your service.xml descriptor, as shown here:

<parameter name=”Sandesha2StorageManager”>persistent</parameter>

That’s all you need to do to enable persistence on top of reliable messaging with WSAS.

Summary
In this article we’ve taken a look at the unreliability of the Internet. We’ve seen how WSRM addresses this problem with a standardized and powerful solution. We’ve looked at how WSRM works with SOAP. Finally, we took a look at WSO2 WSAS’s implementation of WSRM using Axis2 and Sandesha. We saw how easy it is to enable WSRM on both clients and services using WSAS. WSO2 WSAS provides an easy turnkey solution to enable a modern SOAP stack with various WS-* technologies, including WSRM.

Resources

About Michael Galpin
Michael Galpin is an architect at eBay, specializing in presentation technologies. He has been hacking on the web since the 90s, is a frequent writer for IBM developerWorks, and has a degree in mathematics from Caltech.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

SOA World Latest Stories
Most DevOps journeys involve several phases of maturity. Research shows that the inflection point where organizations begin to see maximum value is when they implement tight integration deploying their code to their infrastructure. Success at this level is the last barrier to at-will d...
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 ...
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 l...
Enterprise architects are increasingly adopting multi-cloud strategies as they seek to utilize existing data center assets, leverage the advantages of cloud computing and avoid cloud vendor lock-in. This requires a globally aware traffic management strategy that can monitor infrastruct...
Adding public cloud resources to an existing application can be a daunting process. The tools that you currently use to manage the software and hardware outside the cloud aren’t always the best tools to efficiently grow into the cloud. All of the major configuration management tools ha...
In his session at 20th Cloud Expo, Mike Johnston, an infrastructure engineer at Supergiant.io, discussed how to use Kubernetes to set up a SaaS infrastructure for your business. Mike Johnston is an infrastructure engineer at Supergiant.io with over 12 years of experience designing, dep...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON Featured Whitepapers
ADS BY GOOGLE