Web and Web Services
Web and 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 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).
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.
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).
REST is simpler, more flexible, and easier to implement than SOAP, which is why
it's widely used in modern web and mobile applications.