Sunday, June 16, 2019

Web Services Tutorial

Let us start with an introduction to web services. What is web service? A web service is a software service provided by one device to another device using the web. Web services provide useful information like weather, stock market information, forex rates and many more. The web service runs as a software application on the web service provider. The technologies in which the web service provider and its' clients are written may be different. It does not matter because the communication between the web service provider and its' clients uses standard data formats like XML or JSON. Keep in mind that web services do not have a user interface.

What is Web Service


In the above example, a web server running on Linux provides a web service to a web server running on Windows, which then uses the response data in it's end-user interface. For this to happen, the web service client sends a request to the web service provider and the web service provider sends a response back to the web service client.

Want to learn more? View my 7-minute Web Services Tutorial or read on...

Now, let us understand the advantages of web services. Why web services?
  1. Web services are built with service oriented architecture. The client only needs the web service URL. The client can send requests only when needed. 
  2. The server and the client may be located in any different geographical locations.
  3. The server and the client may be written in different technologies like Java, PHP, C# etc. or running on different operating systems like Unix, Linux, Windows etc. So, web services make possible the data exchange between very different systems.
  4. Web services are written to be consumed by other software applications. The client only gets the needed data in the response. It is easier for the client than having to "scrape" data from a web page, which contains presentation elements too.
Next, how web services work? I have illustrated this in the graphic below:

There are two types of web services - SOAP web services and REST web services:

SOAP (Simple Object Access Protocol) web services - SOAP web services use XML for communication between the client and the server. You can create web service using different web service technologies. Since SOAP web services use XML data format, they are slow.

RESTful (Representational State Transfer) web services - RESTful web services are completely stateless. They can use plain text, HTML, XML or JSON data formats for communication between the client and the server. RESTful web services can also be written using different web service technologies. They are faster because they don't need to follow the many standards that the SOAP web services do. This means that they are better suited for mobile devices with limted bandwidth. RESTful web services are more popular than SOAP web services.

For more details and useful links, please view the Web Services Tutorial. Thank you.

No comments:

Post a Comment