A web service is a web application or component which communicates with other applications using open protocols like HTTP (Hyper Text Transport Protocol), SOAP (Simple Object Access Protocol).
Web services and consumers of Web services (clients) are typically businesses, making Web services predominantly business-to-business (B-to-B) transactions. Web Services will always be accessed by software, never directly by humans even though there might be a human using that software. In simple words, websites for humans, Web Services for applications.
A web service can make itself available over the internet and uses a standardized XML messaging system (SOAP) to code/decode data with other protocols like HTTP being used for transmission.
An example of a Web service is that of a stock quote service, in which the client requests for the current price of a specified stock by sending an XML SOAP message containing the request (probably a stock symbol for a company), and the web service responds with a corresponding XML SOAP response message containing the stock price. Many freely available web services can be found at this location – http://www.webservicex.net/ws/default.aspx.
Advantages of Web Services
Even though we can achieve the same functionality with other distributed technologies like CORBA, EJBs etc, Web Services offer many benefits over other types of distributed computing architectures.
- Web Services are language and platform independent and provide interoperability due to use of open standards and protocols. So software applications written in various programming languages and running on various platforms can use web services to exchange data over computer networks like the Internet.
- Technologies such as CORBA and EJB are geared towards highly coupled distributed systems in which the client and the server are very dependent on each other. But Web Services are more adequate for loosely coupled systems where the client might have no prior knowledge of the Web Service until it actually invokes it.
- Usability – Web Services allow the business logic of many different systems to be exposed over the Web making it easier for any client application built using any technology to access web services.
- Open Standards – Web Services are deployed over standard Internet technologies. This makes it possible to deploy Web Services even over firewall to servers running on the Internet on the other side of the globe. This standardization of protocol stack gives businesses many advantages like wide range of choices, reduction in the cost due to competition and increase in the quality.