You are on page 1of 10

WEB SERVICE TECHNOLOGIES

TOPIC 10

Web Services and the service-oriented architecture (SOA)

What is/are web service/s?


A web service is a software system that supports interoperable machine-to-machine
interaction over a network. It includes any software, application, or cloud technology that
provides standardized web protocols (HTTP or HTTPS) to interoperate, communicate,
and exchange data messaging – usually XML (Extensible Markup Language) –
throughout the internet.
A key feature of web services is that applications can be written in various languages
and are still able to communicate by exchanging data with one another via a web
service between clients and servers. A client summons a web service by sending a
request via XML, and the service then responses with an XML response.

A complete 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

What is service-oriented architecture? (SOA)


SOA is an architectural style for building software applications that use services
available in a network such as the web. It promotes loose coupling between software
components so that they can be reused. Applications in SOA are built based on
services.
SOA uses the find-bind-execute paradigm, service providers register their service in a
public registry. This registry is used by consumers to find services that match certain
criteria. If the registry has such a service, it provides the consumer with a contract and
an endpoint address for that service.
A Service oriented architecture works by passing descriptive information through XML
files from one service to another service, a GUI application to a service, and/or a service
back to a GUI application.
Any organization can utilize Service Oriented Architecture, as it is not specific to any
platform, development language or brand. The first main benefit of a SOA environment
is not recreating the wheel on each team. The second benefit is making sure that
information being returned to clients is consistent across the applications. Finally, as
discussed before, Service Oriented Architecture allows a business to be more agile and
get applications from concept to production quickly.

Summary
Web service is a "call" to an application, a system, or a hub that asks a question, like:
"Does this customer already exist?" By definition, a Web service uses the web to
communicate its business question. SOA, on the other hand, is the architectural
framework that enables a series of those Web services to occur.
WSDL
 WSDL stands for Web Services Definition Language
 WSDL is an XML-based file that basically tells the client application what the web
service does.
 WSDL is written in XML
 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.

The WSDL Document Structure


A WSDL document is used to describe a web service. This description is required, so
that client applications are able to understand what the web service actually does. The
WSDL file contains the location of the web service and the methods which are exposed
by the web service.

The elements of WSDL document.


 Definition: It defines the name of the web service.
 Data types: the data types to be used in the messages are in the form of XML
schemas or possibly some other mechanism.
 Message: an abstract definition of the data being communicated.
 Operation: an abstract description of an action supported by the service.
 Port type: an abstract set of operations supported by one or more endpoints.
 Binding: the concrete protocol and data formats for the operations and
messages defined for a particular port type.
 Port: a single endpoint defined as a combination of a binding and a network
address.
 Service: a collections of network endpoints or ports.

What is SOAP (Simple Object Access Protocol)?

A message mechanism called SOAP (Simple Object Access Protocol) permits


communication between remote components of an application. Several common
protocols, such as the Hypertext Transfer Protocol for the web, can carry SOAP
(HTTP).
In order to allow different programming language applications to communicate
with one another via the internet, SOAP was created as an intermediary language.
Because SOAP is adaptable and independent, programmers can create SOAP
application programming interfaces (APIs)

Extensible Markup Language is frequently used in conjunction with SOAP, a


lightweight protocol for building online APIs (XML). It supports a variety of internet-
based communication protocols, including HTTP, SMTP, and Transmission Control
Protocol. The SOAP method outlines the elements and modules that go into a SOAP
message, the communication protocols that are supported, how a SOAP message is
constructed, and how a SOAP message is handled. The message format for SOAP is
the XML Information Set, and message negotiation and transmission are handled via
application layer protocols like HTTP.

SOAP building blocks and message structure example

Simple Object Access Protocol, as a specification, defines SOAP messages that are
sent to web services and client applications. SOAP messages are XML documents that
are comprised of the following three basic building blocks:

1. The SOAP Envelope encapsulates all the data in a message and identifies the XML
document as a SOAP message.
2. The Header element contains additional information about the SOAP message. This
information could be authentication credentials, for example, which are used by the
calling application.

3. The Body element includes the details of the actual message that need to be
sent from the web service to the calling application. This data includes call and
response information.

4. The Fault message is an optional fourth building block. If a SOAP fault is


generated, it is returned as an HTTP 500 error. Fault messages contain a fault
code, string, actor and detail.

SOAP messages are XML documents that are comprised of three basic building
blocks.

How does SOAP work?


Responses to SOAP requests are simple to generate and process. A client first
creates a request for a service using an XML document. The XML document is then
sent to a SOAP server by a SOAP client. The SOAP message is sent as a service
invocation to the desired server-side application by the server when it has been
received. The SOAP request handler receives a response first, followed by the
requesting client, which includes the requested parameters, return values, and data for
the client. Hypertext Transfer Protocol Secure (HTTPS) or any equivalent protocol, such
as HTTP, is used to convey both SOAP requests and answers.

SOAP advantages and disadvantages

SOAP is an integral part of the service-oriented architecture (SOA) and the web
services specifications.

Advantages of SOAP include the following:

 Platform- and operating system-independent. SOAP can be carried over a


variety of protocols, enabling communication between applications with different
programming languages on both Windows and Linux.

 Works on the HTTP protocol. Even though SOAP works with many different
protocols, HTTP is the default protocol used by web applications.

 Can be transmitted through different network and security devices. SOAP can
be easily passed through firewalls, where other protocols might require a special
accommodation.

Disadvantages, however, include the following:

 No provision for passing data by reference. This can cause synchronization


issues if multiple copies of the same object are passed simultaneously.

 Speed. The data structure of SOAP is based on XML. XML is largely human-
readable, which makes it fairly easy to understand a SOAP message. However, that
also makes the messages relatively large compared to the Common Object Request
Broker Architecture (CORBA) and its remote procedure call (RPC) protocol that will
accommodate binary data. Because of this, CORBA and RPC are faster.

 Not as flexible as other methods. Although SOAP is flexible, newer methods, such
as RESTful architecture, use XML, JavaScript Object Notation, YAML or any parser
needed, which makes them more flexible than SOAP.
Universal Description Discovery and Integration (UDDI)

A set of specifications defining a registry service for Web services and for other
electronic and non-electronic services.

UDDI has two functions:

 It is a SOAP-based protocol that defines how clients communicate with UDDI


registries.
 It is a particular set of global replicated registries.

A UDDI registry service is a Web service managing information about service providers,
service implementations and service metadata. Providers advertise their Web services
on the UDDI registry. Consumers then use UDDI to discover Web services suiting their
requirements and obtain the service metadata needed to consume those services.

A UDDI registry works in the following manner:

1. A service provider registers its business with the UDDI registry.


2. A service provider registers, separately, each service with the UDDI registry.
3. The service consumer looks up the business and services in the UDDI registry.
4. The service consumer binds to the service provider and uses the service.

REST
REST, or Representational State Transfer, is an architectural style for developing web
services. REST is popular due to its simplicity and the fact that it builds upon existing
systems and features of the internet's Hypertext Transfer Protocol (HTTP) in order to
achieve its objectives, as opposed to creating new standards, frameworks and
technologies.

RESTful, A web API that obeys the REST constraints is informal. In general RESTful
web APIs are loosely based on HTTP methods such as GET and POST.
HTTP Verbs
There are 4 basic HTTP verbs we use in requests to interact with resources in a REST
system:
GET — retrieve a specific resource (by id) or a collection of resources
POST — create a new resource
PUT — update a specific resource (by id)
DELETE — remove a specific resource by id

RESTful Web Services


 REST is that the applications we use are browser-based nowadays and top it all,
 Providing the communication between client and server over HTTP protocol
rather than other complex architectures like SOAP and RPC etc.
 Platform independent.
 Language independent.
 Work on HTTP protocol.
 Flexible and easily extendible.
 They also have some constraints or principles.
 Client-Server
 Stateless
 Cacheable
 Uniform Interface
 Layered System
 Code on Demand
Constraints/Principles

Client-Server
Separation of concerns. Client and server are independent from each other.
Goal: Platform independency and to improve scalability.

Stateless
Each request is independent from other requests. No client session data or any
context stored on the server.

Cacheable
HTTP responses must be cacheable by the clients. Important for performance.
If a new request for the resources comes within a while, then the cached
response will be returned.
Uniform Interface
All resources are accessed with a generic interface (HTTP-based). This makes it
easier to manage the communication.

Layered System
There can be many intermediaries between you and the server you are connecting
to. A client does not know if it is connected to the last server or an intermediary server.

Code on Demand
Servers can send some kind of executable scripts to the client-side in order to
increase or change the functionality on the client side. This may cause low visibility, so it
is the only optional.
References:
https://www.techopedia.com/definition/24421/universal-description-discovery-and-
integration-uddi
https://www.studocu.com/in/document/srm-institute-of-science-and-technology/web-
programming/unit-5-lecture-notes-5/5717546
https://www.researchgate.net/figure/Structure-of-WSDL-
Documents_fig11_251423430/amp
https://www.guru99.com/wsdl-web-services-description-language.html#1
https://docs.microfocus.com/SM/9.51/Hybrid/Content/webservicesguide/concepts/wsdl_
document_structure.htm

You might also like