0% found this document useful (0 votes)
4 views

Web and Web Services

The document provides an overview of the Web and Web Services, defining the Web as a system of interlinked documents accessed via the internet. It explains Web Services as a method for communication between electronic devices using standard protocols like HTTP, and outlines key features of SOAP and REST, two types of web services. SOAP is a protocol with a strict structure, while REST is an architectural style that emphasizes simplicity and stateless interactions.

Uploaded by

zainarshad7686
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Web and Web Services

The document provides an overview of the Web and Web Services, defining the Web as a system of interlinked documents accessed via the internet. It explains Web Services as a method for communication between electronic devices using standard protocols like HTTP, and outlines key features of SOAP and REST, two types of web services. SOAP is a protocol with a strict structure, while REST is an architectural style that emphasizes simplicity and stateless interactions.

Uploaded by

zainarshad7686
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Web & Web Services

Web
The Web (short for World Wide Web) is a system of interlinked documents and
resources, primarily accessed via the internet using a web browser (like Google
Chrome, Mozilla Firefox, Safari, etc.).

 Internet:
 Web Page:
Web Service:
A Web Service is a method of communication between two electronic devices over
a network.
Example: SOAP Web services, REST Web Services.
Or

A web service is a software system designed to support interaction between


applications over a network, typically over the internet. It allows different
applications (often running on different machines or technologies) to communicate
with each other using standard protocols.

Key Features of a Web Service:

1. Communication over HTTP: Web services use standard internet protocols


like HTTP (Hypertext Transfer Protocol) or HTTPS (secure version of
HTTP) for communication.
2. Data Formats: Web services usually send data in formats like JSON
(JavaScript Object Notation) or XML (eXtensible Markup Language),
which are both easily readable by humans and machines.
3. Request-Response Model: The most common interaction between a client
(e.g., a web browser, mobile app) and a web service follows the request-
response model. A client sends a request, and the web service returns a
response.
4. Platform-Independent: Web services allow different systems, regardless of
the programming language or operating system, to communicate with each
other. This makes them highly interoperable.
Basic Structure of a Web Service:

A typical web service has a client-server architecture, where the client makes
requests and the server provides responses.

1. Client: The application or system that sends requests to the web service.
This could be a web application, mobile app, or even another web service.
2. Web Service: The system that receives requests and sends back responses. It
contains the logic that performs some function or provides some data. A web
service exposes a set of operations (e.g., "get weather data," "submit a
form," etc.).
3. Protocol: The client and the web service communicate using standard
protocols like HTTP/HTTPS. These protocols ensure that the request and
response can be understood by both the client and the web service.
4. Message Format: Web services typically use XML or JSON to encode the
data being sent between the client and the server. Both are widely used for
data transfer because they are easily parsed and processed by both humans
and machines.

HTTP:
HTTP defines the rules for requesting and sending data (such as HTML files,
images, JSON, etc.) between a client (like your web browser or app) and a server
(where the website or web service is hosted).

Web Services Examples:


SOAP:

SOAP stands for Simple Object Access Protocol, and it's a protocol used for
exchanging structured information between computers over a network (like the
internet). SOAP is commonly used in web services to define the rules for how data
should be packaged, transmitted, and processed.

Key Features of SOAP:

1. Protocol for Communication:


o SOAP is a messaging protocol, meaning it's a set of rules that define
how messages are formatted and transmitted between systems.
o It allows communication between applications running on different
platforms (Java, .NET, etc.) by using a standard message format.
2. Message Format:
o SOAP messages are XML-based. They follow a strict structure,
which is composed of:
 Envelope: Contains the entire SOAP message.
 Header: Contains optional information such as authentication
details, or message routing instructions.
 Body: Contains the actual message or data (the request or
response data).
 Fault: Used to provide error information if something goes
wrong.
3. Transport Protocol:
o SOAP is designed to work over different transport protocols, most
commonly HTTP or SMTP (email), but it can also work over other
protocols like TCP or JMS (Java Message Service).
4. Strict and Formal:
o SOAP is a more rigid and formal standard compared to RESTful web
services. It has a well-defined structure and rules for messages,
headers, and even security.
o SOAP messages can be more complex and require more overhead
compared to RESTful web services.
5. Security:
o SOAP supports advanced security features (through standards like
WS-Security) which allow for encrypted communication,
authentication, and authorization.
6. Stateful Operations:
o SOAP supports both stateful (where information is stored between
interactions) and stateless operations.

REST (Representational State Transfer)

REST is an architectural style for designing networked applications, especially


web services. Unlike SOAP, which is a protocol, REST focuses on using standard
web protocols (like HTTP) and simple principles to create efficient, scalable
services.

Key Features of REST:

 Stateless: Each HTTP request from a client to the server must contain all the
information needed to understand the request. The server doesn’t store any
state about the client.
 Client-Server Architecture: REST follows a client-server model, where the
client (the app or browser) communicates with a server that provides
resources.
 Resources: In REST, everything is considered a resource (e.g., a weather
report, user profile, product info). Each resource is identified by a URL.
 HTTP Methods: RESTful services use standard HTTP methods (GET,
POST, PUT, DELETE) to perform operations on resources.
o GET: Retrieve a resource.
o POST: Create a new resource.
o PUT: Update a resource.
o DELETE: Remove a resource.
 Data Format: REST can return data in JSON or XML format (JSON is
more common in modern APIs).

Example of a RESTful URL:

 GET: GET http://api.weather.com/weather?city=London


 POST: POST http://api.weather.com/weather (to submit weather data)

REST is simpler, more flexible, and easier to implement than SOAP, which is why
it's widely used in modern web and mobile applications.

You might also like