Web Services

Go back to Tutorial

Web services is a standardized way or medium to propagate communication between the client and server applications on the World Wide Web. This course will give a detailed insight into various components of web services like SOAP,WSDL, REST, and how they operate.

Web services provide a common platform that allows multiple applications built on various programming languages to have the ability to communicate with each other

Popular Web Services Protocols are:

  • SOAP: SOAP is known as the Simple Object Access Protocol. SOAP was developed as an intermediate language so that applications built on various programming languages could talk quickly to each other and avoid the extreme development effort.
  • WSDL: WSDL is known as the Web Services Description Language(WSDL). WSDL is an XML-based file which tells the client application what the web service does and gives all the information required to connect to the web service.
  • REST: REST stands for REpresentational State Transfer. REST is used to build Web services that are lightweight, maintainable, and scalable.

A web service is, any service that −

  • Is available over the Internet or private (intranet) networks
  • Uses a standardized XML messaging system
  • Is not tied to any one operating system or programming language
  • Is self-describing via a common XML grammar
  • Is discoverable via a simple find mechanism

Components of Web Services

The basic web services platform is XML + HTTP. All the standard web services work using the following components −

  • SOAP (Simple Object Access Protocol)
  • UDDI (Universal Description, Discovery and Integration)
  • WSDL (Web Services Description Language)

Web Service Working

A web service enables communication among various applications by using open standards such as HTML, XML, WSDL, and SOAP. A web service takes the help of −

  • XML to tag the data
  • SOAP to transfer a message
  • WSDL to describe the availability of service.

You can build a Java-based web service on Solaris that is accessible from your Visual Basic program that runs on Windows.

You can also use C# to build new web services on Windows that can be invoked from your web application that is based on JavaServer Pages (JSP) and runs on Linux.

Example

Consider a simple account-management and order processing system. The accounting personnel use a client application built with Visual Basic or JSP to create new accounts and enter new customer orders.

The processing logic for this system is written in Java and resides on a Solaris machine, which also interacts with a database to store information.

The steps to perform this operation are as follows −

  • The client program bundles the account registration information into a SOAP message.
  • This SOAP message is sent to the web service as the body of an HTTP POST request.
  • The web service unpacks the SOAP request and converts it into a command that the application can understand.
  • The application processes the information as required and responds with a new unique account number for that customer.
  • Next, the web service packages the response into another SOAP message, which it sends back to the client program in response to its HTTP request.
  • The client program unpacks the SOAP message to obtain the results of the account registration process.

Types of Web Services

There are mainly two types of web services.

  • SOAP web services.
  • RESTful web services.

SOAP (Simple Object Access Protocol)

SOAP is known as a transport-independent messaging protocol. SOAP is based on transferring XML data as SOAP Messages. Each message has something which is known as an XML document. Only the structure of the XML document follows a specific pattern, but not the content. The best part of Web services and SOAP is that its all sent via HTTP, which is the standard web protocol.

Here is what a SOAP message consists of

  • Each SOAP document needs to have a root element known as the <Envelope> element. The root element is the first element in an XML document.
  • The “envelope” is in turn divided into 2 parts. The first is the header, and the next is the body.
  • The header contains the routing data which is basically the information which tells the XML document to which client it needs to be sent to.
  • The body will contain the actual message.

WSDL (Web services description language)

A web service cannot be used if it cannot be found. The client invoking the web service should know where the web service actually resides.

Secondly, the client application needs to know what the web service actually does, so that it can invoke the right web service. This is done with the help of the WSDL, known as the Web services description language. The WSDL file is again an XML-based file which basically tells the client application what the web service does. By using the WSDL document, the client application would be able to understand where the web service is located and how it can be utilized.

XML-RPC

This is the simplest XML-based protocol for exchanging information between computers.

  • XML-RPC is a simple protocol that uses XML messages to perform RPCs.
  • Requests are encoded in XML and sent via HTTP POST.
  • XML responses are embedded in the body of the HTTP response.
  • XML-RPC is platform-independent.
  • XML-RPC allows diverse applications to communicate.
  • A Java client can speak XML-RPC to a Perl server.
  • XML-RPC is the easiest way to get started with web services.

SOAP

SOAP is an XML-based protocol for exchanging information between computers.

  • SOAP is a communication protocol.
  • SOAP is for communication between applications.
  • SOAP is a format for sending messages.
  • SOAP is designed to communicate via Internet.
  • SOAP is platform independent.
  • SOAP is language independent.
  • SOAP is simple and extensible.
  • SOAP allows you to get around firewalls.
  • SOAP will be developed as a W3C standard.

WSDL

WSDL is an XML-based language for describing web services and how to access them.

  • WSDL stands for Web Services Description Language.
  • WSDL was developed jointly by Microsoft and IBM.
  • WSDL is an XML based protocol for information exchange in decentralized and distributed environments.
  • WSDL is the standard format for describing a web service.
  • WSDL definition describes how to access a web service and what operations it will perform.
  • WSDL is a language for describing how to interface with XML-based services.
  • WSDL is an integral part of UDDI, an XML-based worldwide business registry.
  • WSDL is the language that UDDI uses.
  • WSDL is pronounced as ‘wiz-dull’ and spelled out as ‘W-S-D-L’.

UDDI

UDDI is an XML-based standard for describing, publishing, and finding web services.

  • UDDI stands for Universal Description, Discovery, and Integration.
  • UDDI is a specification for a distributed registry of web services.
  • UDDI is platform independent, open framework.
  • UDDI can communicate via SOAP, CORBA, and Java RMI Protocol.
  • UDDI uses WSDL to describe interfaces to web services.
  • UDDI is seen with SOAP and WSDL as one of the three foundation standards of web services.
  • UDDI is an open industry initiative enabling businesses to discover each other and define how they interact over the Internet.

Go back to Tutorial

Share this post
[social_warfare]
Software Testing Metrics
Certified Agile Testing Professional

Get industry recognized certification – Contact us

keyboard_arrow_up