What is a web service?
There is a simple definition for a web service but before I get to that I want to set the scene.
Before the emergence of the internet, computers would connect with each other over point to point connections. Initially, the two ends of the communicating systems would need to be written on the same platform in the same technology.
From these early days came the realisation that what was needed to promote machine to machine connections was a standard approach which ideally did not rely upon a single platform or technology. Protocols such as CORBA (Common Object Request Broker Architecture) were introduced to address this need supporting the drive to greater connectivity.
With the emergence of the internet saw the explosion of computer connectivity and with it HTTP (Hyper Text Transfer Protocol) as the dominant force for the internet. Suddenly there were many connected computers, all in a standard way but much of this connectivity was aimed at machine to human.
The machine to machine connectivity, that which allowed software developers to create code which could consume data from another machine, did not lend itself to using HTML over HTTP which the majority of the web was delivering. So, a solution was required; enter SOAP (Simple Object Access Protocol) and the birth of what we today refer to as web services.
So, coming back to our definition of a web service it is:
A service that allows software on one machine to request and consume information from software which may be on another machine in a standard way which is independent of platform and technology used by the communicating parties.
When talking about web services there is much commentary about using XML and HTTP, but these are not requirements of a web service, simply that HTTP is the most prevalent application layer protocol in use today and XML was the basis of SOAP the first mainstream web service standard. You could use SMTP (Simple Mail Transfer Protocol) or GOPHER and you could use HTML or plain text. These are designer choices; you build a web service and publish the means by which consumers can connect; you determine the service calls available and the means by which they can be called.
Why use a web service?
Ok, so a web service is a means for software on one machine to talk to software on another machine. So why would you want to do this?
Well, to support the idea of distributed systems. The idea of having a system that does one thing and does that one thing well.
These days we hear talk of mashups, the Internet of Things (IoT) and microservices. These ideas have all built on the idea of distributed systems. The supply and consumption of various items of data pulled together to make the sum of the information a richer experience.
Web services are simply a means of providing data from one machine to another so that the data can be used to present richer information.
I used to have a saying:
Data is a collection of facts; information is a collection of related data and knowledge is the interpretation of information.
Web services provide data to allow other applications to present information. What we do with that information is up to us.
Types of web service?
There are two main types of web service. Simple Object Access Protocol (SOAP), which we have already mentioned and is the grandad of the web service world and then there are REpresentational State Transfer (RESTful) web services which are claimed to be easier to integrate with web-based technologies and have lighter traffic requirements between calls because they dispense with the XML tags used in SOAP.
That said, both are good options for producing web services and your choice should be based on experience and the desire to keep up to date and in line with popular platforms as well as the overarching driver: the requirement for the solution.
What will you do with web services now?