Web Services Introduction
We can define “Web Service” as a way of communication between multiple and different applications allowing them to operate between each other whether they are on the same or different platforms. An example of this could be an application developed in Java running on a Linux environment communicating with another application entirely developed in .net running on a Windows environment. They can exchange messages between each other by means of exchanging XML messages over an HTTP protocol.
Web services are created as independent services; they are browsers independent and operative system independent, meaning that they could be executed on any browser without making changes to them.
A formal definition could be taken from the World Wide Web Consortium (W3C): “A Web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.”
You can find more information in the following link: http://www.w3.org/TR/ws-arch/#introduction
Some of the special characteristics of a web service are:
XML-based: If all web services protocols and technologies use XML to be their data representation interface, all of these could be interoperable.
Loosely coupled architecture: a web services consumer is not tied with the web service, meaning that the consumer could still interact with the web service even if the interface of the service has changed.
Synchronous or asynchronous implementation: having a client performing synchronous call to the web service means that the client has to block and wait for the service to complete the operation to continue with any subsequent routine. An asynchronous call, allows a client to execute a web service call and then execute other operations immediately, so it could retrieve the result of the call at a later point of time.
Coarse-grained: many object oriented technologies expose services by exposing individual methods of their objects, but for a web service application this could be too fine for an operation. For building a web service it is recommended that the fine-grained methods are composed into a coarse-grained service that could be consumed by an external client even another service.
Support for Remote Procedure Calls: this allows a client to invoke procedures or functions on remote objects using XML-based protocols.
Support document exchange: withXMLyou could not only represent data, but also complex documents. Each of these documents could be as simple as a telephone number or an address, or they could be complex as an entire legal document.
Benefits of Web Services
The following are some of the benefits you would get from using and creating web services:
Interoperability: Web Services allows connecting different applications. By means of web services multiple different applications can communicate with each other sharing information and primarily services between themselves.
Expose your existing services to a network: usually a web service is single block of code that could be invoked remotely with HTTP requests. This allows you to expose current services from your code over a network allowing external applications to access and actually use these exposed services of your application.
Standard protocols: A web service uses industry standard protocols for every layer in the web service protocol stack (Service transport, XML messaging, Service description and Service discovery). This standardization provides many advantages like giving a wide range of choices for each implementation, cost reduction due to competition and increase quality
Low cost of communication: by using SOAP over HTTP protocol for communication you can use the existing internet connections for implementing web services.