Wednesday, June 15, 2011

Webservices for eighth grader

Son: What is web service?

Father: It is a mechanism for computer to computer communication. This communication is independent of make of computer and its operating system. So Windows machine can talk to Apple machine or to Linux machine without any heavy duty translation. Webservice enforces one language across variety of machines. More over this language is readable by humans as well.

Son: Hmm… So which language it enforces?

Father: Let me correct myself. Webservices do not enforce common language but common script. Like Devnagri and Latin are writing systems, scripts to various languages. Devnagri is used to write Hindi, Gujrati, Marathi, and other languages. Latin is for English, German, and French. For Webservices based communication Script is XML and various languages are WSDL, and SOAP. So XML is a system by which one can create new languages.

Son: It is OK. But then how actual communication happens between computers using web services?

Father: Let us make an analogy. You know, how we listen and how sound travels.

Son: Little bit.

Father: No problem. Let us build a scenario. You are asking questions and I am answering them. So you are Client or Customer and I am Provider or Server.

Son: It is easy. One who asks question is Client and one who answers the questions is Server.

Father: Perfect. Let’s move on. We are talking in English. So there is contact between me and you which says that you can ask only in English and I can answer in English. So there is contract between Client and Server. This contract in web services world is defined using WSDL – Web Service Description Language. WSDL also defines what questions a client can ask from Server. Because Sever cannot answer all questions in world, its ability is limited.

Son: It is getting complicated, but still manageable.

Father: Good. Now when I and you are talking we are using air as medium.

Son: Yes, I know it.

Father: In Webservices you can replace air by HTTP. Just think of browser address bar.

Son: Oh! Yes. I see http with your blog address in browser address bar whenever I open browser on your laptop.

Father: You are smart. One more thing, yours and my ears can hear sound if are within certain frequency range. Can you hear sound from dog whistle?

Son: I know humans can hear sound waves which fall between 20 Hz to 20 KHz.

Father: That’s good. You should get good grades in Science.

Son:Thanks .

Father: So, there should be something similar to frequency range. It is SOAP. This is something which defines how information is packed, flowing over air – HTTP.

Son: Cool. It is very straight forward. Script which defines language is equivalent to XML. Contract between client and server is WSDL. Information pack is SOAP

Father: Fantastic. Now you know what Web Services is.

1 comment: