Web Services Computing
Web Services Computing
computing
prepared by : ashish(cse.2A)
Introduction to Web Services
operational model of web services
tools and technologies enabling web
services, benefits and challenges of
using web services.
Imagine you go to a restaurant and want to order food. The process works like
this:
1.You(Customer) – You don’t go directly to the kitchen; instead, you give your
order to the waiter.
2.Waiter(Web Service) – The waiter takes your order and passes it to the kitchen
(the service provider).
3.Kitchen (Server) – The kitchen prepares the food and gives it back to the waiter.
4.Waiter (Web Service) – The waiter brings your food back to you.
In this example
Web service
Why Do We Need Web Some Socializing
Services? Applications :
• To
allow different apps or systems to
share data and functionality.
<soap:Envelope>
<soap:Body> • App Shows the Answer:
<GetWeatherResponse> The app reads the
<Temperature>34 degrees
Celsius</Temperature> response and shows:
"Today in Delhi: 34
<Condition>Sunny</Condition>
</GetWeatherResponse> degrees Celsius, Sunny.
</soap:Body>
</soap:Envelope>
SOAP is Used:
• Built-in
Error Handling – via the Real-World Applications:
Fault section.
• Bank APIs – Transferring money securely
• Extensibility
– Supports security, between banks (NEFT, IMPS APIs).
transactions, and messaging • eBay & PayPal – Their older APIs use SOAP.
patterns.
• Healthcare – Patient data exchange
• Language Independent – Works between hospital systems.
with Java, .NET, Python, etc. • B2B Communications – Between large
companies’ internal software.
(Representational State Transfer)
Think of JSON as a digital way of writing down information, like how we write in
notebooks using keys (name) and values (data).
It is mainly used for sending data between a server and a web browser or mobile
app.
JSON Is Popular:
• It is easy to read and write for humans. It is easy to understand and process by computers.
It is used everywhere — in websites, apps, games, APIs, IoT, and more.
An example :
"order_id": 456,
"customer_name": "Aman",
"total_price": 299
}
How JSON Works (Step by Step)
1. A webpage/app sends a
request to a server.
Operational models define how web services work and interact (the architecture and
communication style).
• Standard protocols define the rules and formats used for communication (the technical
methods for data exchange).
Ex. Google Maps API (Mapping Service), weather upi, youtube upi ( that create web services )
Service registry
Service Registry (Where Are Services Listed)
A Service Registry is like Pages directory ( khata ) where businesses (services) are listed so
that people can find them. It stores and organizes information about available web
services.
How It Works?
1.The Service Provider registers its service in the registry.
2.The Service Requestor searches for a service in the registry.
3.The registry shows a list of available services, and the requestor can choose one.
Real-Life Example: Google Play Store,Zomato,github,aws
• The Google Play Store (Service Registry) lists all available mobile apps.
• If you need a food delivery app, you search for it in the Play Store.
Service requestor
Service Requestor (Who Needs the Service)
A Service Requestor is like a customer who wants to buy a product or use a service. It searches for a
web service, connects to it, and starts using it.
How It Works?
3. The Service Provider sends back the required data, and the requestor uses it.
• Uber’s app (Service Requestor) needs location services to track drivers and customers.
Service Discovery
• UDDI (Universal Description, Discovery, and Integration) – Registry system.
benefits of using web services
• Platform Independent
• Java, Python, PHP apps can all talk using web services.
• Language Independent
• Data is exchanged using common formats (JSON/XML).
• Reusability
• Once built, the service can be reused across apps.
• Modularity
• Easy to break complex apps into microservices.
• Scalability
• Easily scale services as per usage demand.
• Interoperability
• A .NET app can call a Java service seamlessly.
• Low Cost and Time
• Speeds up development with ready-made APIs.
⚠️ 6. Challenges in Using Web Services
Security Concerns
Data sent over networks can be hacked if not encrypted (need HTTPS, OAuth).
Performance Issues
High response time in large services or due to network latency.
Versioning and Compatibility
Changing API structure can break client systems.
Dependency
Third-party services may go down or become paid.
Complex Error Handling
Managing faults in SOAP can be tricky; REST is easier.
Testing Complexity
Testing distributed systems is more difficult than standalone apps.
What Is Web Services Architecture?
<student>
<id>101</id>
<name>Aman</name>
<course>Computer Science</course>
</student>
This XML can be shared between any systems – web,
mobile, desktop – and it will be understood by all.
SOAP (Simple Object Access Protocol)
🔧 Role: A protocol for sending and receiving messages over the internet
Features:
• XML-based
🧠 Real-life Use:
• Publicly
accessible by Get flight details using WSDL-
Airline Website defined web services
consumers
Purpose of UDDI:
• To publish web services (like a company registering on JustDial).
2.Service Bus
1. A communication channel or medium where web
services (like payment, weather, hotel booking APIs)
are available.
2. Has two key service types:
1. Proxy Services
2. Business Services
How Does UDDI Work? Publish
1. Companies register (publish) their web services in the UDDI
registry.
2. Example: OYO uploads details of its hotel booking API.
1.Find (Browse)
1. Users (like app developers) search the UDDI registry to find
services they need.
2. Example: You search “hotel booking service” in UDDI.
2.Use (Import)
1. You get the WSDL link of the service.
2. Then, you import it and use it in your app.
3. Example: You use OYO’s API in your travel app to show hotel
availability.
Examples of UDDI
Government Portals (DigiLocker, 3. Banking Apps (Paytm,
Aadhaar, eGov) PhonePe)
What happens: What happens:
Need to connect with many banks
• These
portals connect to services like and UPI services.
Aadhaar verification, PAN card check, etc.
Example:
Example: Paytm finds “HDFC Bank UPI API” via
UDDI → Imports WSDL → Allows you
• DigiLockerfinds and uses UIDAI (Aadhaar) to send money.
service via UDDI → Verifies Aadhaar
number. Example:
Finds “PNB Balance Check API” →
Example: Integrates in app → User can check
• ImportsIncome Tax PAN API → Verifies bank balance
user’s PAN card.
web services
communication models
Web services need to
exchange information
between clients and servers
over a network. The way they
communicate and interact is
called a communication
model.
These models define:
• How data is sent
• Who sends first
• Who waits for reply
• When data is exchanged
Types of Web Services
Communication Models
Request-Response Model (Synchronous Communication)
Synchronous communication means the client sends a request to the web service and then waits until
the response comes back from the server.
Both parties (client & server) must be online and active at the same time.
🏧 Example : ATM Machine
• You insert your card and
ow It Works : check balance.
• ATM sends request to the
1. Client sends a request (like a question). bank server.
• Waits for response (your
2. Server receives it and processes it.
balance info).
3. Server sends back the response (like an answer). • Then displays it on the
scree
4. Client waits during this whole process.
• 🧠 Think of it like a phone call – you ask something and wait for the other person to reply.
Technologies That Support Synchronous
Communication
Role in Synchronous
Technology / Protocol
Communication
Basic communication
HTTP/HTTPS
protocol (web)
Secure and reliable XML
SOAP
messaging
Simple and fast data
REST API
exchange using JSON
High-performance sync calls
gRPC
(Google)
One-Way Message Model
(Asynchronous Communication)
One-Way Message Model (Asynchronous Communication) – Detailed
Explanation
In simple terms:
Tools:
• Postman – to test APIs
• VS Code / IntelliJ – code editors
• Browser / Terminal – for testing
curl
• Curl (in Terminal
http://localhost:5000/student
6. Connect with Database (Optional)
• Heroku
• Render
• AWS
• Azure
• Google Cloud
Example: Your local service → localhost:5000
Deployed version → https://myapp.onrender.com/student
9. Document the API