25Jan 2021

Web Services: Definition and its Need in Modern Business Operations

Introduction

A web service is a standardized communication medium between a server and the client on the internet. Being a software module, it performs specific kinds of tasks. In cloud computing, web services are used to provide various functionalities when invoked by a client.

In this article, we introduce the basic concepts surrounding web services:

  • Their working
  • the need 
  • types
  • advantages
  • architecture 
  • characteristics

How Web Services Work

how-web-service-work

The figure above shows a typical web service at work. The client computer invokes various calls as requests to the server that hosts the web service.

The process of making requests is called remote procedure calls (RPC). RPC targets the host of a web service and calls specific methods.

An example of a web service is amazon.com, an online store for selling products[1]. The client can be accessing the web service using a .Net or Java user interface, and both of the interfaces can communicate with the web service.

Transfer of data between client and server applications happening in the form of XML (Extensible markup language) documents is the major design concept of web services.

XML is easy to understand just as HTML and many programming languages understand it. It provides a platform of communication for applications developed using different programming languages[2].

To exchange the XML data between systems or applications, the Simple Object Access Protocol (SOAP) is used. According to Gudgin,  the XML document being transferred from a web service to the client is the SOAP message[3].

This makes it possible for clients written in different languages to exchange data with the web service because a soap message is written in XML.

The Need for Web Services

The evolution of the internet has seen the integration of modern web-based applications into business operations. The applications are written in a variety of programming languages e.g. Java, .Net, Angular JS, Node.js, etc.

This becomes a nightmare for different applications to communicate accurate information. This gave the rise to web services that enable communication between applications built in different programming languages.

Web Services Types

web-services-types

There are only two and they include:

  • SOAP web service
  • RESTful web service

For everything to be in place, web services must meet some minimum requirements. This is irrespective of the programming language the application is written. Let us take a look at the individual components:

1. SOAP (Simple Object Access Protocol)

SOAP is known for transporting XML data in the form of SOAP Messages. It is an independent transport protocol. An XML document follows a specific structural pattern.

The most interesting part of sending SOAP messages and web services is that all happen via HTTP (the standard web protocol).

Elements of a SOAP message

  1. <Envelope> the root element in an XML document. It is further divided into two parts: 
  2. header – contains routing information, i.e the client destination to receive the document
  3. Body – holds the actual message

The figure below shows a simple example of SOAP communication

soap-communication

2. WSDL (Web Services Description Language)

A web service existence must be known before requesting a service. If a service is not found, it cannot be used. The client should further be aware of what the service does to invoke the appropriate web service.

A WSDL document describes the services offered by a web service. This enables a client to find a service and invoke the right method.

  • The following are aspects to note about WSDL:
  • <message> in the definition of WSDL, this parameter defines the different data elements for each web service operation. In the example displayed in the figure above, two messages are being exchanged between the applications i.e “DetailsRequest’ and ‘DetailsResponse” operations. The DetailsRequest contains the ‘DetailsID’ element which is a string type. Likewise, the DetailsResponse contains the ‘DetailsName’ element of string type. 
  • <portType> this element defines the operation which can be done by a webs service, in this case, Details. It takes an input and output message
  • <binding> the protocol to be used is contained in this element. Other details such as whether the message should be encoded and namespace can be declared in this element

3. Universal Description, Discovery, and Integration

Contains the accepted rules for discovering, describing, and publishing web services provided by a specific web service provider[4]. It defines particulars that help in hosting web service information.

In the previous section, we discussed that WSDL contains information about what a web service does. The question remains how a client computer can locate a WSDL file and read the contents.

This is answered by the UDDI, which acts as a database for hosting WSDL files. So the client can access the WSDL file through the UDDI.

The UDDI can be compared to a phonebook directory that contains an individual’s name, contact, address. Similarly, UDDI will have relevant information regarding a web service so that a client can access the WSDL and understand all the operations offered by a server.

Advantages of Web Services

In the previous sections, we have discussed why web services came into play in the first place, which is to enable applications written in different programming languages to communicate with each other.

Now let us look at the benefits of using web services:

  1. Taking business operations to the internet. A web service provides functionalities to client applications via HTTP, which means that it can be accessed from anywhere on the internet. Businesses that have taken their operations online are finding web services very useful in providing the functionality required.
  2. Enhanced communication. Web services have enabled applications written in different programming languages to communicate and exchange data between themselves. A generic code understood by all applications is used rather than a platform-specific code which is understood by only a specific application.
  3. A common protocol is understood by everyone and helps communication of applications. All the layers in the protocol stack of services understand known protocols.
  4. Efficiency in communication. Web services can be implemented using low-cost internet because they use SOAP over HTTP for communicating.

Web Services Architecture

Each framework has a set of components that work together to get the desired result. Similarly, the following components are present in web service architecture:

  • Provider – Builds the web service and making it work for a client looking for the service
  • Service requestor – An application on the client-side that needs to use functionality offered by a web service. The client application can be written in any programming language but still be able to communicate with the server application. 
  • Broker – This is no more than the application granting the client application access to the UDDI. The client will locate the web service and read the WSDL file.
web-services-architecture
  • Publish – A provider makes available the service to all clients who are using the broker’s interface for publishing and informs the broker about the web service existence
  • Find – The service requestor tries to find a published web service through the broker
  • Bind – Requestor can do web service invocation using information gained 

Characteristics of Web Services

characteristics-of-web-services

Web services have unique features in their behavior as follows:

  1. Web services are XML based, that is they use XML to transport and represent data in the transportation and representation layers respectively[4]. XML eliminates the need for an operating system, networking features, and any sort of platform dependency since all programming languages understand XML. 
  2. Loosely coupled, meaning that the web service and client applications have no relation whatsoever. In other words, if the web service changes over a given time, the process a client calls the web service should not change[4]. Loosely coupled architecture adoption has made it easier to manage software systems and integrate them with others. 
  3. Synchronous or asynchronous functionality – Synchronous is the state when a client is bound to particular service execution. A client waits for a particular web operation to finish before another begins[4]. For example, in databases is when performing a read and write operation, where data is read from one database and written onto another. Asynchronous operations, on the other hand, allow a client application to execute other functions in parallel after invoking a service. This is probably the most used technique today which ensures that other services don’t stop while carrying out particular operations.
  4. Support for (RPCs) Remote Procedure Calls– To enable method or function invocation on remote objects by client applications, an XML-based protocol is used. The remote functions expose input or outputs supported by a web service. 
  5. Support for document exchange – The generic way of representing complex documents and data using XML is of great benefit. From simple documents to an entire book, XML perfectly represents the data.

A Web Service use Case

a-web-service-use-case

This section gives more insight into web services using a travel agent scenario. The agent is looking to offer booking capabilities of complete vacation packages: bus tickets, train, plane, hotels, excursions, car hire, etc.

Service providers (hotel chains, bus companies, airlines, etc.) avail web services to clients to make reservations. Financial companies are playing their part to guarantee payments by providing a large number of payment web services and make a coin from each transaction.

The consumer can then make a reservation from a large variety of options available. In this case, the user interacts with machines only in the process of making a booking.

Individual goals

  • The customer’s goal is to find the best combination of services and needs that suit their wants. 
  • The travel agent hopes to meet customer demands by supplying various packages that the customer can compare.
  • The service providers aim at increasing product sales as much as possible.
  • The credit card companies guarantee their clients of making their payment services available when needed

Usage scenarios

This usage scenario describes how a developer would make the service available and how a user can make a booking of a package.

usage-scenarios

For this scenario to be practical, some requirements must be met:

  • Each step must be highly reliable for profitability
  • The services must trust each other for such a partnership
  • Providers must describe how to interact with their web services to achieve the desired output.

For most of such transactions, the WSDL file is in the WSDL primer

Context

Steps a user takes to make flight destination inquiries

  1. The user fills a form providing details about travel destination and dates
  2. The user submits the details to find out flight schedules
  3. The travel agent service looks for flights in the list of services it has
  4. The agent presents the requests for available flights to meet the user needs
  5. The agent presents the results to the user for them to make the best decision

Steps for choosing a flight and finding a hotel

  1. The user communicates flight choice to the agent service
  2. A request is sent to the airline service to withhold the seat
  3. Airline responds with a confirmation identifier
  4. The agent service searches its hotels’ catalog
  5. The agent looks for accommodation options for each hotel and payment services available
  6. The agent service then presents the results to the user allowing them to make the best choice

Steps to book a flight and hotel

  1. The user informs the travel agent of their accommodation preferences
  2. The travel agent service informs the payment service of the user’s choice to make a payment
  3. books a hotel
  4. Confirms the flight
  5. Charges a user some fees
  6. Presents to the user identity confirmation details 
  7. exits

Conclusion

Before the introduction of web services, there was no streamlined exchange of data among the various technologies, business to business (B2B) operations, or vendors.

The evolution of web services has seen interoperability and system integration in the digital landscape. Today, web services provide a platform for less complexity and more functionality. 

Acodez is a renowned web development company and web application development company in India. We offer all kinds of web design and Mobile app development services to our clients using the latest technologies. We are also a leading digital marketing company providing SEO, SMM, SEM, Inbound marketing services, etc at affordable prices. For further information, please contact us.

Looking for a good team
for your next project?

Contact us and we'll give you a preliminary free consultation
on the web & mobile strategy that'd suit your needs best.

Contact Us Now!
Jamsheer K

Jamsheer K

Jamsheer K, is the Tech Lead at Acodez. With his rich and hands-on experience in various technologies, his writing normally comes from his research and experience in mobile & web application development niche.

Get a free quote!

Brief us your requirements & let's connect

Leave a Comment

Your email address will not be published. Required fields are marked *