What are Web Services ?

A service can be one of the three types of interactions :

  • man-to-man
  • man-to-machine
  • machine-to machine

A restaurant service is an example of man-to-man interaction. A person withdrawing money from an Automated Teller Machine (ATM) is an example of man-to-machine interaction. Machine-to-machine interaction is exemplified by a handheld device, such as a smart device (e.g., a phone or a tablet), synchronizing its address book with Microsoft Outlook. A Web Service is a type of machine-to-machine interaction that uses specific Web standards and technology. A Web Service is a set of programming interfaces, not a set of webpages.

According to Gartner research (June 15, 2001), “Web services are loosely coupled software components delivered over Internet standard technologies.”

Web services are based on the concept of service-oriented architecture (SOA). SOA is the latest evolution of distributed computing, which enables software components, including application functions, objects, and processes from different systems, to be exposed as services.

In short, Web services are self-describing and modular business applications that expose the business logic as services over the Internet through programmable interfaces and using Internet protocols for the purpose of providing ways to find, subscribe, and invoke those services.

Based on XML standards, Web services can be developed as loosely coupled application components using any programming language, any protocol, or any platform. This facilitates delivering business applications as service accessible to anyone, anytime, at any location, and using any platform.

Consider the simple example shown below, where a travel reservation services provider exposes its business applications as Web services supporting a variety of customers and application clients. These business applications are provided by different travel organizations residing at different networks and geographical locations.

Fig : Example scenario of Web Services

The following is a typical scenario:

  • The Travel service provider deploys its Web services by exposing the business applications obtained from different travel businesses like airlines, car-rental, hotel accommodation, credit card payment, and so forth.
  • The service provider registers its business services with descriptions using a public or private registry. The registry stores the information about the services exposed by the service provider.
  • The customer discovers the Web services using a search engine or by locating it directly from the registry and then invokes the Web services for performing travel reservations and other functions over the Internet using any platform or device
  • In the case of large-scale organizations, the business applications consume these Web services for providing travel services to their own employees through the corporate intranet.

Web services are typically implemented based on open standards and technologies specifically leveraging XML. The XML-based standards and technologies, such as Simple Object Access Protocol (SOAP); Universal Description, Discovery, and Integration (UDDI); Web Services Definition Language (WSDL); and Electronic Business XML (ebXML), are commonly used as building blocks for Web services.

Characteristics of Web Services

The basic characteristics of a Web services application model are as follows:

  • Web services are based on XML messaging, which means that the data exchanged between the Web service provider and the user are defined in XML.
  • Web services provide a cross-platform integration of business applications over the Internet.
  • To build Web services, developers can use any common programming language, such as Java, C, C++, Perl, Python, C#, and/or Visual Basic, and its existing application components.
  • Web services are not meant for handling presentations like HTML context—it is developed to generate XML for uniform accessibility through any software application, any platform, or device.
  • Because Web services are based on loosely coupled application components, each component is exposed as a service with its unique functionality.
  • Web services use industry-standard protocols like HTTP, and they can be easily accessible through corporate firewalls.
  • Web services can be used by many types of clients.
  • Web services vary in functionality from a simple request to a complex business transaction involving multiple resources.
  • All platforms including J2EE, CORBA, and Microsoft .NET provide extensive support for creating and deploying Web services.
  • Web services are dynamically located and invoked from public and private registries based on industry standards such as UDDI and ebXML.

Why Use Web services:

Traditionally, Web applications enable interaction between an end user and a Website, while Web services are service-oriented and enable application-to-application communication over the Internet and easy accessibility to heterogeneous applications and devices.

The following are the major technical reasons for choosing Web services over Web applications:

  • Web services can be invoked through XML-based RPC mechanisms across firewalls.
  • Web services provide a cross-platform, cross-language solution based on XML messaging.
  • Web services facilitate ease of application integration using a lightweight infrastructure without affecting scalability.
  • Web services enable interoperability among heterogeneous applications

Key Benefits of Web services:

The key benefits of implementing Web services are as follows:

  • Platform-independent : Web Services are now available in nearly all platforms:
    • Hardware: mainframe, midrange, personal and mobile devices
    • Operating systems : UNIX, Windows, Mainframe OS, Android, and iPhones
  • Reuse of existing networking infrastructure: HTTP, SMTP, and JMS protocols.
  • Loose-coupling of software components promotes software reuse.
  • Reduced integration cost and increased integration speed.
  • Open architecture and communication protocols

Working of Web services:

Web services use the request-response method to communicate among applications. For any communication, we need a medium and a common format that can be understood by everyone, in the case of web services medium is the internet and the common format is the XML (Extensible Markup Language) format as every programming language can understand the XML markup language.

A client is the one that requests some service from the server that is known as the service provider. The request is sent through a message which is in common XML format and in response to that request, the service provider will respond with a message in a common format (.i.e. XML).