App Architecture.com

web services

By Stephen J. Bigelow

What are web services?

Web services are a type of internet software that use standardized messaging protocols and are made available from an application service provider's web server for a client or other web-based programs to use. These services are sometimes referred to as web application services. They provide powerful, flexible interoperability, enabling machine-to-machine interactions across a network even with machines and software stacks not designed to work together natively.

A web service supports a specific task or set of tasks. A formal description specifies the web service and includes all the details needed to interact with it, such as message formats and protocols. This lets almost any hardware or software stack use the service regardless of the underlying platform and programming language used to build the service. This independence enables complex cross-platform interactions that simplify and streamline data access and transactional behavior.

Web services range from major services such as storage management and customer relationship management to more limited services such as furnishing a stock quote and checking bids for an auction item.

Users can access some web services through a peer-to-peer arrangement rather than a central server. Some services can communicate with other services. Middleware generally accommodates this exchange of procedures and data. The need for web services emerged as all major platforms were able to access the internet, but different platforms couldn't interact with each other. Web services took platforms to the next level by publishing functions, message, programs and objects to the rest of the internet.

Types of web services

Web services are built using open standards and protocols to integrate with various applications. The protocols web services use include the following:

How web services work

Web services let different organizations or applications from multiple sources communicate without the need to share sensitive data or IT infrastructure. Instead, all information moves through a programmatic interface across a network. This interface can then be added to a GUI, like a webpage, to deliver specific functionality to users. This means web services aren't specific to one programming language or operating system (OS) and don't require the use of browsers or Hypertext Markup Language (HTML).

Most web services operate using a typical client-server behavior. An application running on a client computer or mobile device has access to a network such as the internet. A server provides data and compute capabilities.

The process includes the following three steps:

  1. The client sends a request to the server that includes details and data the web service requires. The data can be in any common format such as JavaScript Object Notation (JSON) or XML.
  2. The server side receives and authenticates the request, parses the required details, processes the request and accesses any appropriate results.
  3. The server accesses any appropriate results and sends them back to the client application, which displays them in a form and style appropriate for the application.

The key to this process is that the client application is loosely coupled -- meaning it has no relationship at all -- to the server or data services. The web service lets the client communicate with the server. As a result, many applications, written by countless developers and businesses, can use a web service to access compute or data services.

Websites that use web services to access and display map data from a major service like Google Maps are an example of these client applications. None of those websites know or care how Google Maps works. It's the web service that provides a common means of interacting with Google Maps to obtain Google Maps data.

Characteristics of web services

Web services typically use XML for information exchange and have certain other common characteristics, including the following:

Uses of web services

Web services are used for many tasks, with the most common being reusing code, delivering services, and connecting existing programs.

Reusing code

With its universal communication protocols, the web service method can help developers segment applications into components that can be reused for various needs. For example, several programs might need a conversion tool or a reporting function. Rather than build these functions into every program, they can be built as standalone services and made accessible through web services. Other programs can then use the appropriate web service to invoke the standalone services as needed. This results in smaller, simpler applications that are faster to develop and easier to test and maintain.

Delivering services

Businesses wanting to get revenue from data and compute services, often use data sources as a business service that can be provided to consumers. Web services are a popular mechanism for exposing those services to outside developers, tracking web service use and generating billable activity based on web service access.

Connecting existing programs

Web services can be used to link data between different platforms. Because all applications can include a web services component, this can turn any program into a fully interoperable one. Wrapping an existing or legacy application in a web service is an effective way to convert an older application into a network-capable application, which can modernize it without having to recode it from scratch.

Examples of web services

The following examples show how web services are used in real-life applications:

These are a few of the many examples of web services available. Any business with data or compute services to offer can expose those resources through a web services interface or API. This can allow an organization to exchange information between enterprise applications, interact with business partners and users, and bill for web services access and use to generate revenue.

Advantages of web services

Web services offer many compelling advantages, such as the following:

Challenges of web services

As web services proliferate, concerns include the overall demands on network bandwidth and, for any particular service, the effect on performance as demands for that service rise. Several new products have emerged that let software developers create or modify existing applications that can be published as web-based applications. However, there are other potential issues with web services, including the following:

SOAP vs. REST

Web services are all about accessing and exchanging information. These services depend on data protocols, the rules that define how data is handled and moved so both sides of a communication link can understand it. SOAP and REST are the two most popular data exchange protocols.

SOAP

SOAP is highly structured. It uses an XML data format and typically HTTP or SMTP for data transmission. SOAP is stateful and uses WSDL to describe the web service model that defines how its requests and responses are structured; it includes well-defined security standards.

SOAP-based web services are easier to consume than REST. They involve more standards and support advanced capabilities such as distributed computing. However, SOAP web services are more complex to develop, implement and support than REST.

REST

By comparison, REST is a flexible, stateless protocol that supports data exchange in varied formats. REST is object-based and uses HTTP for key processes such as DELETE, GET, POST and PUT. But REST formally defines little else, allowing data transfers using plain text, HTML, XML and JSON. REST is considered a lightweight protocol that's easier to build and understand than SOAP services. However, REST is typically limited to point-to-point communications, and the lack of deeper standards can lead to performance and interoperability limitations.

It's important to note that SOAP and REST protocols are both popular and used widely for web services. The question is not which is better, but rather which protocol is best-suited to the web service being developed.

APIs vs. web services

There are many similarities between web services and APIs. The terms are often used interchangeably, though this is technically incorrect.

There is considerable overlap between web services and APIs. Essentially, web services are a subset of APIs. A web service is a type of API, and most web services provide an API. One way to implement an API is as a web service, but not all APIs are web services.

Learn more about building a successful enterprise API strategy in this comprehensive guide.

21 Mar 2024

All Rights Reserved, Copyright 2019 - 2024, TechTarget | Read our Privacy Statement