martedì 6 marzo 2012

SOAP vs REST . Web service architectures milestones


This is what I've studied at university... but it's seriously more funny ! :-) Some useful consideration on the two main basic tecnologies to develop web services.

Web service introduction

The Web was born in the '90s as a platform for sharing documents distributed on different machines and interconnected. Everything is born and has evolved through the standardization of some simple concepts:

  1. URI - mechanism to locate resources in a network.
  2. HTTP - simple and lightweight protocol to request a resource to a machine.
  3. HTML - the language for the representation of content

This simple initial idea has evolved over the years in both the basic concepts, as in the way of understanding them and using them. 
The multimedia contents have been added to the initial text, documents are generated dynamically and not published as static pages, and then the Web exits from the initial hypertext vision only to become a container of interoperable software applications: a distributed applications platform.This perspective has given rise, around the year 2000, the concept of Web Service: a software system designed to support interaction between applications, using standard Web technologies and the mechanism of the Web Service allows you to interact transparently applications developed with different programming languages, running on heterogeneous operating systems.

This mechanism allows you to create portions of functionality independently of platforms and potentially incompatible by the various parts interact through Web technologies and creating modular architecture easily.


SOAP and REST

At present there are two approaches to create Web Service

  • One approach is based on the standard protocol SOAP (Simple Object Access Protocol) for exchanging messages through the invocation of remote services, aims to play in the Web approach to remote calls, remote procedure call, typical protocols for interoperability such as CORBA, DCOM, and RMI.


  • A second approach is based on the principles of Web architecture typical and focuses on the description of resources, how to locate them on the Web and how to transfer them from one machine to another. This is the approach that we discuss called REST (Representational State Transfer).


Differences between REST and SOAP Web service


Soap Web Service, is also known as WS-*, with a clear reference to the prefix used in the various standards defined by W3C, and was the first (the wsdl) way to develop end exposing web service.


The first obvious difference between the two types is proposed as the vision of Web computing platform.  
  • REST offers a vision of the Web focuses on the concept of a resource  
while 
  • the SOAP Web Service emphasize the concept of service.


  • A RESTful Web Service is the custodian of a collection of resources on which a client can ask the canonical operations of HTTP
  • A SOAP based Web Service exposes a set of methods can be called remotely from a client.

The approach of SOAP Web service has borrowed an application architecture referred to as SOA, Service Oriented Architecture, which has recently opposed the architecture ROA, Resource Oriented Architecture, inspired by the REST principles.

SOAP (Simple Object Access Protocol) defines a data structure for the exchange of messages between applications, reinventing a sense of what was already the HTTP protocol.

SOAP uses HTTP as the transport protocol, but is not limited or bound to it, since it may well use other transport protocols.

Unlike HTTP, however, the SOAP specifications do not underline issues such as safety or addressing, for which standards have been set aside, specifically WS-Security and WS-Addressing.

So SOAP is not fully exploits the HTTP protocol, using it as a simple transport protocol.
REST uses HTTP instead for what it is, an application layer protocol, and uses the full potential.
  The REST approach, however, tends to preserve and enhance the inherent characteristics of the Web by highlighting a predisposition to be a platform for distributed computing.


So, no need to add anything to what already exists on the Web to allow remote applications to interact.


In addition, the Web Service SOAP-based provide the standard WSDL, Web Service Description Language, to define the interface of a service.This is further evidence of the attempt to adapt the approach to Web interoperability based on remote calls.In fact, the WSDL is nothing more than an IDL (Interface Description Language) for a software component.On one hand the existence of WSDL facilitates the use of tools to automatically create client in a particular programming language, but at the same time leads us to create a strong dependency between client and server.REST does not explicitly provide any way to describe how to interact with a resource.The operations are implicit in the HTTP protocol.




Nessun commento:

Posta un commento