MOD 4 Web Services Notes
MOD 4 Web Services Notes
The objective is to understand the intricacies of web services and discover how they empower cloud-
based solutions.
Example
Imagine booking a flight online. The website interacts with a web service provided by an airline to
check availability and book your ticket. The airline's web service handles the complex backend
processes.
Simple Object Access Protocol(SOAP) is a network protocol for exchanging structured data between
nodes. It uses XML format to transfer messages. It works on top of application layer protocols like
HTTP and SMTP for notations and transmission. SOAP allows processes to communicate throughout
platforms, languages, and operating system, since protocols like HTTP are already installed on all
platforms.
● Envelope: This specifies that the XML message is a SOAP message. A SOAP message is an
XML document containing a header and a body, both encapsulated within the envelope. Any
fault is included within the body of the message.
● Header: This part is optional. When present, it can provide crucial information about the
applications.
● Body: This contains the actual message being transmitted. Faults are contained within the
body tags.
● Fault: This optional section contains the status of the application and any errors. It should
not appear more than once in a SOAP message.
Advantages of SOAP
● SOAP is mainly used for Web Services and Application Programming Interfaces (APIs).
The UDDI standard includes a set of specifications that define a distributed registry service for web
services. It is an XML-based and platform-independent framework that uses Web Service Definition
Language (WSDL) to describe interfaces to web services. It is also an open, industry-wide framework
since it lets all kinds of businesses list themselves on the Internet and discover, interact with and
carry out transactions with each other.
UDDI Registry: A central repository that stores information about businesses and their Web
services.
UDDI Nodes: Servers that host the UDDI registry. These nodes can be operated by different
organizations and can be replicated to ensure high availability.
UDDI Client: An application that interacts with the UDDI registry to publish or discover Web
services.
UDDI relies on a distributed registry of businesses plus their service descriptions, implemented in a
common XML format, to manage and enable the discovery of web services. Web service providers
advertise their services on the UDDI registry that manages all the information about the provider,
service implementations and service metadata. Organizing and cataloging web services on a registry
allows for sharing and reuse within an enterprise or with an external partner. Today, these registries
are based on the UDDI 3.0 specification.
Two types of registries are available: private and public. A private registry lets businesses publish and
test their internal web applications in a secure, private environment. A public registry consists of
peer directories containing information about businesses and their web services. Both private and
public registries comply with the same specifications.
WSDL is XML based language format used to describe functionalities and operations involved in web
services. it basically tells the client application what the web services do. The general structure of
WSDL consists of Definition, target namespace, Datatypes, Messages, Port-type, Bindings, and
services.
o Definitions: It is the basic element of the WSDL document that contains the definition of one
or more services.
o Types: The Type element is used to give information about the complicated data types used
within the WSDL document.
o Message: It contains abstract data that is being used in communication between client and
web server. It also defines the data elements for each operation.
o Port: It is used to define the single endpoint as an address for the binding.
o Services: It is a collection of endpoint networks that specify the port address for the binding.
o Binding: It specifies how operations are implemented by concrete protocols and data format
features for operation and messaging.
Structure of WSDL Document
Remote procedure calls are used to perform these requests. The calls to the methods hosted by the
respective web service are known as Remote Procedure Calls (RPC). Example: Flipkart provides a
web service that displays the prices of items offered on Flipkart.com. The front end or presentation
layer can be written in .NET or Java, but the web service can be communicated using a programming
language.
The data exchanged between the client and the server, XML, is the most important part of web
service design. XML (Extensible Markup Language) is a simple, intermediate language understood by
various programming languages. It is the equivalent of HTML.
As a result, when programs communicate with each other, they use XML. It forms a common
platform for applications written in different programming languages to communicate with each
other.
Web services employ SOAP (Simple Object Access Protocol) to transmit XML data between
applications. The data is sent using standard HTTP. A SOAP message is data sent from a web service
to an application. An XML document is all that is contained in a SOAP message. The client application
that calls the web service can be built in any programming language as the content is written in XML.
(b) Loosely Coupled: The subscriber of an Internet service provider may not necessarily be directly
connected to that service provider. The user interface for a web service provider may change over
time without affecting the user's ability to interact with the service provider.
(c) Ability to be synchronous or asynchronous: Synchronicity refers to the client's connection to the
execution of the function. Asynchronous operations allow the client to initiate a task and continue
with other tasks. The client is blocked, and the client must wait for the service to complete its
operation before continuing in synchronous invocation.
(d) Coarse Grain: Object-oriented systems, such as Java, make their services available differently. At
the corporate level, an operation is too great for a character technique to be useful. Building a Java
application from the ground up requires the development of several granular strategies, which are
then combined into a coarse grain provider that is consumed by the buyer or service.
(e) Supports remote procedural calls: Consumers can use XML-based protocols to call procedures,
functions, and methods on remote objects that use web services. A web service must support the
input and output framework of the remote system.
(f) Supports document exchanges: One of the most attractive features of XML for communicating
with data and complex entities.
(g) Platform Independence: Web services can be accessed by applications running on any platform,
regardless of programming language or operating system, promoting interoperability.
(h) Reusability: Web services can be reused by multiple applications, reducing development time
and effort. This promotes modularity and fosters efficient code sharing.
(i) Standardized Protocol: Web services rely on standardized protocols like HTTP, SOAP, and REST.
These standards ensure that communication is consistent and predictable, regardless of the specific
implementation of the web service.
(j) Statelessness: Web services are often stateless, meaning that each request is treated
independently of previous requests. This simplifies the design and implementation of web services
and improves scalability.
2 Reusability - Enables modular design and service composition, saving development time.
4 Cost-Effectiveness - Reduces infrastructure and maintenance costs with pay-as you-go models.
Collaboration Tools - Collaboration tools like Google Docs and Microsoft Teams utilize web services
to facilitate real-time document editing, file sharing, and communication. Examples - Dropbox,
Google Drive, Trello, Zoom.
Social-Media - Social media platforms use web services for user authentication, content sharing, and
real-time updates, connecting users worldwide. Examples - Facebook, Twitter, Instagram.
Streaming Services - Streaming services like Netflix and Spotify leverage web services to deliver
content on-demand(CDNs), providing personalized recommendations and user profiles. Examples -
Youtube.