Thursday, February 10, 2011

What is Webservices in layman terms?

Web services and S.O.A. (Service Oriented Architecture) are the latest fad that has taken the world by storm. But I have rarely come across a good book or a good site that  explains Web Services in a simple and prosaic manner. So lets have a layman’s view into the web service paradigm and explain the Basic’s of Web services (WS).

Before We delve into the technical details of WS lets look at it in a simple context. If we break down the term it comes from 2 words
  • Web
  • Services.
Services - A service is a facility or service that is provided by some body. This could be a paid service (for example a hair cut) or a free service (waiter at a restaurant).The main actors (design parlance) in this are
  • The person who provides the service (provider) and
  • The person who utilizes this service or consumes this service (Consumer / Client)
Web - The World Wide Web  or internet which serve’s as a common platform for communicating. There are 2 factors that come into play when  we consider the term Web.
  • There needs to a channel for communication on which 2 parties (i.e. Provider and Consumer) can meet
  • There needs to be a common mode of communication between the two.
If I were to build on an example of a real life scenario of you going for a hair cut.
There are 2 actors or parties in this interaction. The barber and you.
The Barber who gives you a hair cut is the “Provider“. You are the “Client/Consumer” who would receive the haircut. The barber shop is the place where you get the service. To reach to the barber shop you take a Car or Walk. Once you reach the shop you need to explain to the barber what your inputs on the type of haircut and this has to be communicated to the barber effectively and in a common language that both parties understand. At the end of the service you make a payment (and if this is complimentary it may be free of charge).

Now when we translate the same scenario to the virtual world,consider a scenario where you build a program which needs a real time conversion of currency from dollars to local currency. There is a provider(your local travel agent’s website) who has offered to provide this service. To enable your program to be able to communicate to the service agent’s website/computer you need to connect to his computer (using http or jms) and send him input in a format that he can understand (and is preferably standardized) which in this case becomes SOAP/XML.  If we were to paraphrase this interaction:

Any webservice has the following elements :
  • Provider – A provider of a service/facility on the web. This could be something like a IP Geolocation tracker or A currency converter.
  • Consumer/Client – A program that intends to consume or utilize the service that the provider is providing.
  • SOAP/XML – A common way of transfer of data such that it is possible for both the entities to understand and exchange data. This has to be a standard way of communicating so that independent of the programming language used.
  • http/jms/smtp – A standard channel of communication that can be initiated / developed between 2 programs.
In my next post i will develop more on the topic of how webservice communication takes place and where WSDL/SOAP and HTTP come into picture exactly.

5 comments:

  1. Perfect explanation!!!!

    ReplyDelete
  2. good kick start

    ReplyDelete
  3. Amazing explanation...this can be definitely used for any presentations to be made on web services for the ones who would have either heard of it rarely or might have never heard of it (it would be strange to find anyone in this category though!!)

    ReplyDelete