The most important thing to remember in this post is ‘Web service is not web site’ !
Many people have this misconception that website is web services. Websites and Web Services are two different things.
So what is web service?
In short,
Friend Finder in Facebook is web service.
Importing contacts in one mail box from other is a Web service.
Currency Converter in various websites is a web service.
Web service is a function that is invoked, when two different websites or devices try to communicate with each other on internet. So if Gmail wants to talk with Facebook, it will invoke Facebook’s web service. The communication is done via different markup languages like JSON, XML, WSDL etc. We will get into details in some time.
Types of Web services :
-
Reusable Application Components.
-
Connect existing software.
1. Reusable Application Components.
- The websites that offer Currency Converter, unit converter, Degree to Fahrenheit converter, Time zone converter etc. all these websites use Reusable web service.
- These are common things people use, so writing a program and executing it each time can be a tiresome process.
- So here, we define a web service, for each type of converter the website offers. When an user tries currency converter and enters the data, the web service of Currency Converter is invoked, and it converts the currency and gives the output.
- Its main feature is Re-usability. You can reuse this web service as many times as you want.
2. Connect existing software.
Have you ever tried the ‘Friend Finder’ of Facebook? What does it do?
- Well it opens a new windows, then asks you which mail provider you use.
- When you select your mail provider, say Yahoo, it then gives you a yahoo login page and asks you to sign in.
- Once you sign in, you can see a progress bar, and then the small window closes, and you’re back on Facebook, with a list of your friend’s name, who are on Facebook but not in your friend lists.
What just happened here? Well the Facebook invoked a web service of Yahoo mail, when you selected Yahoo.
For a temporary period, Facebook was given access to your contact list of yahoo. Facebook then copied the list, checked for the users using that E-mail address on Facebook, and checked if you have them in your friend list.
The users whom you don’t have then appear in front of you.
So here Web service of Facebook communicated with yahoo using a web service.
Same thing happens when you import contacts from Yahoo to Gmail.
Some sites offer you to directly use their services by logging in from your Facebook account.
When you’re on YouTube and you click the share button Web service is invoked.
When you’re reading some article on some website, and you decide to share it on Facebook, web service is invoked.
So we can say, Internet wouldn’t be the same without Web Services 😀
Today, many websites uses SOA (Service Oriented Architecture) for web services because
- SOA is Platform Independent.
Industries can use any platform of their choice and use SOA on it. - SOA gives re-usability feature, which means you can use the same service again and again.
- SOA saves the confidentiality and integrity of data .
- Maintenance and Integration cost is low in SOA.
There is also RESTful Web service, which is based on REST (Representational State Transfer).
REST basically tells us
- To use to HTTP protocols
- Treat everything as a resource (Image, data, videos)
- Give each resource an unique address.
- Keep the interface as simple as possible.
Websites like Yahoo and Twitter use REST.
Reference : W3Schools
Very good. useful information for all …
Great