Friday, October 24, 2008

Web Services Platforms: Composition and Philosophy

Not surprisingly, contrary to common knowledge SOAP today stands for nothing... some one must be seariously embarassed to refer to it as 'Simple' :) There are so many specifications heard some one saying here are 105 of them!! That very moment I found it over zealous to study and all of them and considering my feeble mindedness, I'm sure to get lost in them. But then, what next?!! I just can't give up like that, after all I have a stiff nose to save ;) They say 'you are what you abstract it from' and may be that's right... may be I need to understand the 'big picture' and then drill down to details subject to interest and need. Here, today a first attempt is made to understand web service as a platform architecture and defining philosophies of some of its more popular implementations.

Web Services Platform Architecture

Web service technology provides a uniform usage model for components/services, especially within the context of heterogeneous distributed environments. It also virtualizes resources by shielding idiosyncrasies of the different environments that host those components. This shielding can occur by dynamically selecting and binding those components and by hiding the communication details to properly access those components. Put simply, these web services technologies serves as a toolset which can primarily be divided into three core subsystems:

  1. Invocation: Upon receiving a service invocation request over a supported transport protocol (HTTP[S], JMS, SNMP etc) a set of handlers need to to pre-process the message as per the QoS (quality of service) requirement (like reliability, security etc.) and then the target Java class (call it first language interference, I'm told something similar happens in other languages too...) is idenified. But before delegating the message for processing it needs to be de-serialized to Java objects and later the response is serialized back to XML documents, which are further handed over to transport layer for onward message delivery. Roughly the same happens on client side albeit in the reverse order.
  2. Serialization: is the process of transforming a Java object into XML element and the reverse process is called De-Serialization. Arguably, this is the most important step as it determines performance and flexibility of the web services platform, among other things. To accomplish this the serialization engine needs a set of 'mapping strategies' to serialize an instance of Java class into instances of XML Schema components. A 'mapping strategy' associates a Java class its target XML Schema type and a description of serializer that will transform an instance of Java into an instance of the Schema type (or vice versa). It should be noted that, Objects are serialized through a 'serialization context' and that the serialized form of object may differ based upon the "context", i.e. what object have been serialized before. Thus a 'Serialization Context' is set of 'Mapping Strategies' that can be used by serialization subsystem to implement the type mapping used by a particular Web Service deployment. Common type mapping mechanism are Standard Binding, Annotations, Algorithmic and Rule Based (need to explore further...)
  3. Deployment: This subsystem supports invocation of a Java target as a Web Service, which includes publishing he WSDL, configuring the end-point listeners and SOAP handlers, mapping WSDL operation to Java method calls and defining the Serialization Context for binding the WSDl operations to Java targets.
Having understood the central concepts associated with a Web Service Platform, it should now give us some basic parameters using which we can compare and contrast different web services implementations. Primary, among them are;

  • JAX-WS 2.0: Assumes a uniformly available Java Universe and thus makes all efforts to make it increasingly simple for a Java Developer to rexpose their applications as web services with annotations and tool support to generate real robust WSDL. Java Interfaces forms the starting point.
  • Apache Axis2: Backed by strong community support this implementation makes it easy to start from either a WSDL or a Java interface and Axis2 with new object model in place boasts of improved performance and flexibility.
  • Apache CXF: Boasts of ease of use and very high performance because of using the new 'pull' parsing technique and the object model.

Hopefully, this article helps us understand the composition of different WS implementations and make an informed decision in their selection for our projects at hand.

No comments: