The post name itself is a big question as “What is a Web Service ? – Definition and Architecture” This question is most widely used in computer programming interviews as well as “Web Service” is most widely used the term in the computer programming world. So, let’s know about this term in a brief and crispy way.
What is a Web Service?
In simple and easy language, web service is an application or a business logic which is accessible using standard Internet protocol called as HTTP (Hyper Text Transfer Protocol). It is generally a service offered via the WWW (World Wide Web) between two different software systems to transfer their data between them.
Some important points that best describe the term “Web Service” are:
- It is a unit of managed code that can be accessed remotely using HTTP over the WWW network which can be either internet (public network) or intranet (private network).
- It is independent of any programming language or any platforms (operating systems).
- It is a method of communication between two different software systems often need to exchange their data with each other. The software system that requests the data is Service Requestor and the software system that would process the requested data and provide the results is Service Provider.
- It is an application built on top of open standards such as TCP/IP, HTTP, HTML, Any programming language, and XML.
- Best example which can explain web service is Facebook (Facebook is also a web service as it allows to get the user-specific data through the service requests)
Why we use a Web Service?
The main reason why we use web service is that of it’s three main features that it provides:
- Inter-operability (Exchange of data between different systems): Web Services allows data transfer between programming languages. They are used to make the application platform and technology independent.
- Standardized Protocol: Web Services uses standard protocol stack for communication. This standard protocol stack gives the business many advantages with a wide range of choices, reduction in cost and increase in their quality.
- Low Cost of Implementation: Web Services uses the very low-cost implementation of a service request and transport the data over the network. There are two different approaches which are very lost cost: SOAP (Simple Object Access Protocol) and FTP(File Transfer Protocol).
One organization/system needs to exchange their data with another organization/system, then how they can exchange their data using the web service? This is another question which started pinching in our mind now. Right !
Here are some more questions related to Web services which need to be clarified.
- How can one system request the data from another system?
- What specific parameters/format are needed in the request?
- How will the data be structured by the service provider before sending it to service requestor?
- What will happen if the data request does not follow the rules while sending to the service provider?
So, the real answer to all the above questions is a set of rules called protocols which make every step possible. Similarly, web services also use some protocol for their data communications between different channels called as WSDL (Web Service Description/Definition Language) which is one of the components of the web service.
What are the components of a Web Service?
The components of the web service will contribute together to receive the data requests and transfer the data from different software systems. The components of web services are:
- XML-RPC (eXtensible Markup Language – Remote Procedure Call): This is also one of the protocols used by web services because web services send the requested data in the form of XML format. So, XML-RPC protocol uses XML to encode its calls and HTTP as a transport medium. Service requests are encoded in XML and sent to the service provider by HTTP POST. It is also platform independent and the easiest way for communication.
- SOAP (Simple Object Access Protocol): This is also one of the communication protocol used over XML requests for exchanging the data. Its main purpose is to include:
a. Extensibility (Implementation to be done by considering future growth)
b. Neutrality (Not to get conflict either physically or ideally)
c. Independence (Not dependent on either Programming language or platform)
- WSDL (Web Service Description/Definition Language): It is an XML based interface definition language used for providing the common standard to web services so that the providers and requestors speak the same language over their communication. Current version of WSDL used is 2.0
- UDDI (Universal Description, Discovery, and Integration): It is a directory or service broker which standardizes the publishing (for service providers) and finding (for service requestor) of the web services.
How does a Web Service work ? or Architecture of a Web Service
We will understand the working of a Web Service with the help of a simple example.
Imagine a web-based application needs to display the weather conditions of your current location as a small module of their application. Then the applications need to either develop the separate module for the same which may take a lot of time and cost. OR they can induce web services in their application to get the weather conditions by simply passing the location details to the service providers. Here,
Service Requestor: An application which needs to display the weather condition based on the location.
Service Provider: Any third party application who has registered its services in UDDI directory for the weather reports.
So, the service provider and the service requestor can easily communicate using web service through the below diagram (Architecture of the Web Services):
What are the limitations of a Web Service?
Every system or application has some dark side of its own. So, web service also has some limitations on its own. Some of them are:
- It is a SOAP-based service and can return data only in the XML formats.
- It only supports the HTTP protocol over the network.
- It can only be hosted on IIS server. (In Java-like programming language it uses Apache Axis which internally uses IIS)
- It is not an open source but can only be used by any client that understands XML.
- It is not lightweight architecture as it uses SOAP protocol which is very heavy in its architecture.
Read more on Computer Programming articles:-
Contribute to EduTechLearners:-
Please write comments if you want to share more information regarding the above notes. If you want some more notes/books on any of the topics please mail to us or comment below. We will provide you as soon as possible and if you want your’s notes to be published on our site then feel free to contribute on EduTechLearners or email your content to firstname.lastname@example.org (The contents will be published by your Name).