There are a lot of changes going on right now in the area of Web Services technologies.
The transition from RPC to document style, and the recent buzz around REST, raise the question as to what the technology is evolving into, why, and along which patterns - if any.
I'll try here to do a recap on the history of web services.
In my next posts I'll try to take a look at the trends and review them against existing technology diffusion, acceptance, and evolution models.
A short history of web servicesDistributed computing and interoperability is nothing new and the origins of web services should probably include efforts by
DARPA to interconnect distributed computers.
In the enterprise world, flat file exchange via shared directories was a popular technique for exchanging information between different systems.
In the banking world,
SWIFT -a private financial messaging network established in the '70s, with its own protocol and message format- is still a very much established standard.
Serializing the object model - CORBA, RMI, and DCOM
In the late '90s, a number of technologies allowing remote procedure calls (
RPC) from one system to another became popular:
.
CORBA allowed distributed software components to collaborate with a language and platform-neutral remote procedure call specification.
.
RMI was essentially offering something similar, except it was entirely java based. As such it was somewhat easier to implement (at least for java programmers) but was also restricted to interoperability between java programs.
. On the Microsoft side,
DCOM allowed native Windows programs to interact.
All of these competing standards had at least a couple major limitations:
1. They were restricted in terms of platforms they could interoperate with
2. It was a major challenge to have them work securely over Internet firewalls.
XML-RPC The momentum java was gaining at that time, and its main value proposition to run anywhere, seemed to have prompted Microsoft to come up with a cross-platform interoperability standard, which could potentially help them get out of the corner they were slowly being pushed into.
In 1998,
XML-RPC was advocated by Microsoft as a truly open technology leveraging the web infrastructure.
XML-RPC is essentially a remote procedure call protocol which uses XML format to encode its calls, and HTTP as a transport mechanism.
XML-RPC is a very simple protocol, defining only a handful of data types and commands - and this simplicity made it quite popular across major platforms.
SOAPThe XML-RPC standard quickly evolved into the more elaborate
SOAP specification.
SOAP is a natural extension of XML-RPC that provides a greater level of structure and support for data types and operations semantic.
During the same timeframe, the need arose to provide more automation around message parsing, code generation, and discovery of web services over the network.
WSDL became the standard for defining web services interfaces; and
UDDI became the standard for registering and finding web services on the Web.
There is today a considerable amount of tooling available for generating web services interfaces (i.e. WSDL) based on existing classes and interfaces, or for generating client libraries based on a WSDL.
Together, SOAP, WSDL, and UDDI form what is commonly referred as Web Services.
From RPC-style to Document-style As Web Services usage gained momentum, a gradual transition occurred from RPC-style to Document-style.
In the RPC pattern, a client sends a request to a server, and the server immediately sends a response back to the client.
The RPC model is similar to existing programming models, and RPC-style Web Services are often implemented by simply generating services interfaces that map directly to existing language-specific function or method calls.
A major issue with this approach is the stability of the object model that these interfaces are based on: as classes’ attributes and operations change throughout their lifecycle, corresponding web service interfaces need to be re-generated accordingly, resulting in brittle and complex interfaces. A better approach is to provide a layer of abstraction by first defining the interface - a.k.a.
Façade.
Another issue is that the RPC-style inherently requires synchronous processing – The RPC-style mandates the client end-point to be expecting the remote procedure call to return from the server-side.
Document-style Web Services offer a more radical alternative by putting the emphasis on publishing a schema, and exchanging messages, rather than on defining a rigid set of operations.
The Document-style approach is also known as the messaging model, or the SOA style (although the later term is overly abused, as can be seen on its
Wikipedia definition page)
Unlike RPC Web services, loose coupling is more likely, because the focus is on the document "contract" that the WSDL provides, rather than on the underlying implementation details of operations.
As such Document-style services can be more agnostic to how, when, and by whom they are going to be consumed.
[A good technical article on Document-style web services can be found
here]
Even when properly designed, SOAP-based web services often end up being complex to the point where directly coding against them would be a daunting task; and it is quite common to see enterprise web services packages heavily rely on the client-side libraries they’re delivered with - essentially reducing web services to some kind of middleware messaging protocol.
REST In reaction to this complexity, RESTful web services are now becoming quite popular -at least in discussion forums-.
REST is a concept that was presented in 2000 and lays out a number of principles. The concept is still quite new when applied to web services, and a number of divergent definitions of what constitute RESTful web services are available.
The general focus is on interacting with stateful resources, rather than messages or operations.
Grossly oversimplified, RESTful web services heavily rely on standard operations already defined by the http protocol: GET, POST, but also PUT and DELETE. These operations allow to interact with stateful resources uniquely identified on the network, and to specify whether a given resource should be created, updated, or deleted.
The prototypical example of a RESTful type of "web service" is RSS, which consists of an http GET operation that returns an XML formatted representation of the state of resources exposed by the server.
.
While there is a great level of antagonism in forums between proponents of REST vs. SOAP (the REST folks are typically more vocal), it's not clear that both technologies conflict: SOAP is well suited for supporting complex business operations, while REST is most appropriate for implementing simpler operations on simpler schema. In other words, REST seems to be well suited for broadly distributed, consumer-focused, web services (e.g. that of amazon.com or Google) while SOAP seems to be more suited for the enterprise world, where the challenges are around exposing complex legacy services, with requirements on security and transactionality.
In my next post, I'll try to look at some sources and data points for further analyzing the adoption trends.