You are on page 1of 7

Definition of a web service.

A web service is either: a service offered by an electronic device to another electronic device, communicating with each
other via the Internet, or a server running on a computer device, listening for requests at a particular port over a
network, serving web documents.

A web service is a software system or function that can communicate and share data with other software systems or
functions over a network. It has an interface that hides the implementation details and allows it to be used
independently of the hardware, software, or programming language. A web service is described using a standard, formal
XML notation that provides the details necessary to interact with it, including message formats, transport protocols, and
location. A web service can fulfill a specific task or a set of tasks.

Software components independent of hardware, programming language and operating system

Software components are independent of hardware, programming language and operating system. Software comprises
the entire set of programs, procedures, and routines associated with the operation of a computer system. The term was
coined to differentiate these instructions from hardware—i.e., the physical components of a computer system. Software
development refers to a set of computer science activities dedicated to the process of creating, designing, deploying
and supporting software. Software itself is the set of instructions or programs that tell a computer what to do. It is
independent of hardware and makes computers programmable

Defining a web service in a WSDL document

A WSDL is an XML document that describes a web service. It actually stands for Web Services Description Language. A
WSDL document describes a web service. It specifies the location of the service, and the methods of the service, using
these major elements: The main structure of a WSDL document looks like this: <definitions> <types> data type
definitions… </types> <message> definition of the data being communicated… </message> <portType>
HTTP as a transport so applications can communicate using Web services

HTTP is used as a transport so applications can communicate using Web services because it is a widely used protocol for
communication on the Internet. It is simple and easy to use, and it is supported by many programming languages and
operating systems.

What is JSON and Example of JSON data format?

JSON stands for JavaScript Object Notation. It is a lightweight data interchange format that is easy for humans to read
and write and easy for machines to parse and generate. JSON is a text format that is completely language independent
but uses conventions that are familiar to programmers of the C family of languages, including C, C++, C#, Java, JavaScript,
Perl, Python, and many others. JSON is often used when data is sent from a server to a web page.

Here are some examples of JSON data format:

"name": "John",

"age": 30,

"city": "New York"

What is Representational State Transfer (REST) as an architecture?

Representational State Transfer (REST) is an architectural style for providing standards between computer systems on
the web, making it easier for systems to communicate with each other. REST-compliant systems, often called RESTful
systems, are characterized by how they are stateless and separate the concerns of client and server. REST is an
alternative to SOAP and JavaScript Object Notation (JSON).
What is Hypermedia as the engine of Application State (HATEOAS)

Hypermedia as the Engine of Application State (HATEOAS) is a constraint of the REST application architecture that
distinguishes it from other network application architectures. With HATEOAS, a client interacts with a network
application whose application servers provide information dynamically through hypermedia.

The term “hypermedia” refers to any content that contains links to other forms of media such as images, movies,

and text.

REST architectural style lets us use the hypermedia links in the API response contents. It allows the client to dynamically
navigate to the appropriate resources by traversing the hypermedia links.

Navigating hypermedia links is conceptually the same as browsing through web pages by clicking the relevant
hyperlinks to achieve a final goal.

Hypermedia as the Engine of Application State (HATEOAS) is an important principle of the REST application
architecture. The principle is that the model of application changes from one state to another by traversing the
hyperlinks present in the current set of resource representations (model). Let's learn this principle in detail.

Comparison of REST/HATEOAS approaches with Service-Oriented Architecture (SOA)

Service-Oriented Architecture (SOA) is an enterprise-wide approach to software development of application


components that takes advantage of reusable software components, or services¹. REST/HATEOAS approaches are
different from SOA in that they are more lightweight and flexible. REST/HATEOAS approaches are more focused on the
web and are designed to work well with HTTP, while SOA is more focused on enterprise applications

What is SOAP?

SOAP is a protocol which was designed before REST and came into the picture. The main idea behind designing SOAP
was to ensure that programs built on different platforms and programming languages could exchange data in an easy
manner. SOAP stands for Simple Object Access Protocol.
What is REST?

REST was designed specifically for working with components such as media components, files, or even objects on a
particular hardware device. Any web service that is defined on the principles of REST can be called a RestFul web service.
A Restful service would use the normal HTTP verbs of GET, POST, PUT and DELETE for working with the required
components. REST stands for Representational State Transfer.

Key Difference between SOAP and REST API

SOAP stands for Simple Object Access Protocol whereas REST stands for Representational State Transfer.

SOAP is a protocol whereas REST is an architectural pattern.


SOAP uses service interfaces to expose its functionality to client applications while REST uses Uniform Service locators
to access to the components on the hardware device.
SOAP needs more bandwidth for its usage whereas REST doesn’t need much bandwidth.
Comparing SOAP vs REST API, SOAP only works with XML formats whereas REST work with plain text, XML, HTML and
JSON.
SOAP cannot make use of REST whereas REST can make use of SOAP.

SOAP REST
SOAP stands for Simple Object Access REST stands for Representational State
Protocol Transfer
REST is an Architectural style in which a web
service can only be treated as a RESTful service
SOAP is a protocol. SOAP was designed if it follows the constraints of being
with a specification. It includes a WSDL
1. Client Server
file which has the required information
2. Stateless
on what the web service does in addition
3. Cacheable
to the location of the web service.
4. Layered System
5. Uniform Interface
SOAP cannot make use of REST since REST can make use of SOAP as the underlying
SOAP is a protocol and REST is an protocol for web services, because in the end it
architectural pattern. is just an architectural pattern.
REST use Uniform Service locators to access to
SOAP uses service interfaces to expose the components on the hardware device. For
its functionality to client applications. In example, if there is an object which represents
SOAP, the WSDL file provides the client the data of an employee hosted on a URL as
with the necessary information which http://demo.guru99 , the below are some of URI
can be used to understand what services that can exist to access them.
the web service can offer. http://demo.guru99.com/Employee

http://demo.guru99.com/Employee/1
SOAP requires more bandwidth for its
usage. Since SOAP Messages contain a
lot of information inside of it, the
amount of data transfer using SOAP is REST does not need much bandwidth when
generally a lot. requests are sent to the server. REST messages
<?xml version="1.0"?>
<SOAP-ENV:Envelope mostly just consist of JSON messages. Below is
xmlns:SOAP-ENV
="http://www.w3.org/2001/12/soap-envelope"
an example of a JSON message passed to a web
SOAP-ENV:encodingStyle
=" http://www.w3.org/2001/12/soap-
server. You can see that the size of the message
encoding"> is comparatively smaller to SOAP.
<soap:Body> {"city":"Mumbai","state":"Maharastra"}
<Demo.guru99WebService
xmlns="http://tempuri.org/">
<EmployeeID>int</EmployeeID>
</Demo.guru99WebService>
</soap:Body>
</SOAP-ENV:Envelope>
SOAP can only work with XML format. As REST permits different data format such as
seen from SOAP messages, all data Plain text, HTML, XML, JSON, etc. But the most
passed is in XML format. preferred format for transferring data is JSON.
How a SOAP service may be accessed by an application given a WSDL definition

A SOAP service can be accessed by an application given a WSDL definition by using the WSDL file to generate test
requests, assertions and mock services. The WSDL file is an XML-based definition language that describes the
functionality of a SOAP-based web service.

What is SOAP?

SOAP is an XML-based protocol for accessing web services over HTTP. It has some specification which could be used
across all applications.

SOAP is known as the Simple Object Access Protocol, but in later times was just shortened to SOAP v1.2. SOAP is a
protocol or in other words is a definition of how web services talk to each other or talk to client applications that
invoke them.

Basic messaging framework for web services

Web services are built on top of open standards such as HTTP, XML, and SOAP1. SOAP is a transport-
independent messaging protocol that is used by all typical web services1. Windows Communication
Foundation (WCF) is a framework for building service-oriented applications that uses SOAP2. Asynchronous
message-based communication is used in web services to send data as asynchronous messages from one
service endpoint to another

Envelope (what is in the message and how to process it), encoding rules and convention for
representing procedure calls and responses.

SOAP is an XML-based protocol for accessing web services. The SOAP message contains an envelope that
describes what is in the message and how to process it. The encoding rules and convention for representing
procedure calls and responses are also included in the SOAP message.
Major characteristics: extensibility, neutrality, independence

SOAP has several major characteristics including extensibility, neutrality, and independence. SOAP is
extensible because it allows for the addition of new features and functionality. It is neutral because it can be
used with any programming language or operating system. Finally, it is independent because it can operate
over any transport protocol such as HTTP, SMTP, or TCP

SOAP has three major characteristics:


 extensibility (security and WS-Addressing are among the extensions under development)
 neutrality (SOAP can operate over any protocol such as HTTP, SMTP, TCP, UDP)
 independence (SOAP allows for any programming model)

State the Processing model that defines the rules for processing SOAP messages

The processing model that defines the rules for processing SOAP messages is a distributed processing model
in which a SOAP message is passed between SOAP nodes. The message originates at a SOAP sender and is sent
to a SOAP receiver. Between the sender and the receiver, the message might be processed by one or more
SOAP intermediaries

You might also like