SlideShare a Scribd company logo
WEB SERVICES
(REST / SOAP)
Presented By:
Ashwani
(Sr. Software Engineer)
What is Web Service
lA software system designed to support
communication between machine-to-machine over
a network
lprovide standared format of communication
lPlatform independent communication
Built on PHP
OS: Apache
Built on .NET
OS: Windows
Where we use Web Service
lWeb services allows you to expose the functionality of your
existing code over the network.
lOnce it is exposed on the network, other application can
use the functionality of your program without passing actual
logic or code
lCan be consider as a class and object in refrence of OOPS
lLike Payment Gatway, google API, etc
Where we can use Web Service
API
Where we can use Web Service
SMS Service
Organization Other Bussiness
organization
API
Request
API
Response
SOAP
(Simple Object Access Protocol)
REST
(Representational state transfer)
Type Of Web
Service
Web Services
How Web Services Work
lLet assume two different platform is present
lOne built on PHP( app1) and other on .NET(app2) and is on
diffrent server
lHere we need
lmedium 'HTTP' / 'Internet' protocal
lFormat XML / JSON (comman format that both will
understand)
SOAP
lUse Meduim 'HTTP POST' Method
lFormat is always XML
REST
lUse Medium “ HTTP POST PUT GET
DELETE PATCH what ever format HTTP
support”
lUSE FORMAT XML, JSON, Text what ever
format HTTP support
What is Restful web service
lA web service which is used to communicate between clinet-
server using REST Arch. / principle.
lREST is an architectural style, while SOAP is a protocol.
REST is not a standard in itself, but RESTful implementations
make use of standards, such as HTTP, URI, JSON, and XML.
Principle of REST Architecture
lUser interface
lStateless
lCacheable
lLayered System
lCode on Demand (optional)
User Interface
1) Resource:- Every thing is resource
2) URI:- Any resource data can accessed by URI
3) HTTP:- make use of HTTP method
Employee
- id
- name
Designation
- id
- name
And many more...
1. Resource: Every thing is resource
Emplyee
managment
system
Employee
- id
- name
Designation
- id
- name
And many
more.......
Emplyee
managment
system
Employe
e
Designatio
n
1. Resource: Every thing is resource
Employee
- id
- name
Designation
- id
- name
And many
more.......
Emplyee
managment
system
Employee
Designatio
n
1. Resource: Every thing is resource
Every module of project we can define
As Resource
Employee
- id
- name
Designation
- id
- name
And many
more.......
Emplyee
managment
system
Employe
e
Designatio
n
1. Resource: Every thing is resource
2. URI: Any Resource can be accessed
by URI (Uniform Resource Identifier)
For Example:
www.myrest.com/designation
www.myrest.com/designation/1
0
Resource
URI
What will be url if i want all employee having
given
Designation?
Employee
- id
- name
Designation
- id
- name
And many
more.......
Emplyee
managment
system
Employe
e
Designatio
n
1. Resource: Every thing is resource
2. URI: Any Resource can be accessed by URI (Uniform Resource Identifier)
For Example:
www.myrest.com/designation
www.myrest.com/designation/1
0
Resource
URI
www.myrest.com/designation/10/employe
e
Employee
- id
- name
Designation
- id
- name
And many
more.......
Emplyee
managment
system
Employe
e
Designatio
n
1. Resource: Every thing is resource
2. URI: Any Resource can be accessed by URI (Uniform Resource Identifier)
For Example:
www.myrest.com/designation
www.myrest.com/designation/1
0
Resource
URI
3. HTTP Verb
VERB
lGET
lPOST
lPUT
lDELETE
Employee
- id
- name
Designation
- id
- name
And many
more.......
Emplyee
managment
system
Employe
e
Designatio
n
1. Resource: Every thing is resource
2. URI: Any Resource can be accessed by URI (Uniform Resource Identifier)
For Example:
www.myrest.com/designation
www.myrest.com/designation/1
0
Resource
URI
3. HTTP Verb
VERB
lGET
lPOST
lPUT
lDELETE
Nam
e
Stateless
:
lServer does not maintatin any data of any previous request has been made
lNo Session
lEvery request will be independent and its client responsiblity to send all details
whatever needed fro that request
lFor example:
Client Serve
r
www.apicall.com/login + POST data (uname +
pass)
Response: { status: success, auth token: xyz
}
www.apicall.com/myPayslip + authtoken (in
header)
Cachin
g
lThis happen at client side.
Responses must therefore, implicitly or explicitly,
define themselves as cacheable or not to prevent clients from reusing
lstale or inappropriate data in response to further requests
lWell-managed caching partially or completely eliminates some client–server
interactions, further improving scalability and performance.
Layering:
A client cannot ordinarily tell whether it is connected directly to
the end server, or to an intermediary along the way.
Intermediary servers may improve system scalability by
enabling load balancing and by providing shared caches. They
may also enforce security policies.
Clinet ServerProxy Cache
REST Summary
lREST is architectural Structure
lWe must follow all principle of REST in order to improve
performace, Portablity, Visibility, Simplicity
Web Service Authentication
lFor Authentication you can use any logic which ever seems to
be secure can be used
lBasic Authentication
l- pass username and password in header
Web Service
Authentication(cont.)
lCustom Authentation
lWhen login generate token and send in response
lThis will be saved in cookies and will be used to pass
along with further transaction by setting this in header
lCan use Oauth2
lYou can create your own authentication(can change header),
it totaly depends on developer only security is concern.
Web Service
Web Service
Authentication(cont.)
lCustom Authentation
lWhen login generate token and send in response
lThis will be saved in cookies and will be used to pass
along with further transaction by setting this in header
lCan use Oauth2
lYou can create your own authentication(can change header),
it totaly depends on developer only security is concern.
What is SOAP
lSOAP is also web service but use medium as a POST
lSOAP is protocol used for exchanging data between client and
server
lIT uses XML technologies as a messaging.
lXML -> eXtensible Markup Language.
lHTML -> Hyper text Markup Language
lSOAP can work on HTTP, SMTP, FTP
lSOAP is platform- and language-independent
lSOAP defines its own security known as WS Security.
Request and Response
The SOAP Structure
lA SOAP message contains 3 parts:
lEnvelope: defines the content of the message
lHeader (optional): contains header information
lBody: contains call and response information
From the http://schemas.xmlsoap.org/soap/envelope/
namespace
SAOP Envelope
The SOAP envelope indicates the start and the end of the
message so that the receiver knows when an entire message
has been received
The Envelope is the top element of the XML document
representing the message.
The Envelope element is always the root element of a
SOAP message.
The Envelope element contains an optional Header
element followed by a mandatory Body element.
SOAP Envlope Code
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header> <!-- optional -->
<!-- header blocks go here... -->
</soap:Header>
<soap:Body>
<!-- payload or Fault element goes here... →
</soap:Body>
</soap:Envelope>
SOAP Sample
SOAP Example (cont.)
SOAP Vs REST
SOAP REST
SOAP is a protocol REST is an architectural style.
Standards to be strictly followed. does not define too much standards
like SOAP.
SOAP requires more bandwidth and
resource than REST.
REST requires less bandwidth and
resource than SOAP.
SOAP permits XML data format only. REST permits different data format
such as Plain text, HTML, XML,
JSON etc.

More Related Content

PDF
Web service introduction
PPT
Java web services
PDF
Web Services (SOAP, WSDL, UDDI)
PPTX
Soap web service
PPT
Intro to web services
PPTX
SOAP--Simple Object Access Protocol
PDF
Java Web Services [1/5]: Introduction to Web Services
Web service introduction
Java web services
Web Services (SOAP, WSDL, UDDI)
Soap web service
Intro to web services
SOAP--Simple Object Access Protocol
Java Web Services [1/5]: Introduction to Web Services

What's hot (20)

PPT
WebService-Java
PPTX
Simple Object Access Protocol (SOAP)
PDF
Web Service Implementation Using ASP.NET
PDF
SOAP-based Web Services
PDF
Web Services Tutorial
PPT
PPT
Soap and Rest
PPT
WebServices SOAP WSDL and UDDI
PPTX
Soap vs rest
PDF
Lecture 3 soap
PDF
Introduction to SOAP
PDF
Java Web Services [3/5]: WSDL, WADL and UDDI
PPTX
Web Services - A brief overview
PPTX
Web services soap and rest by mandakini for TechGig
PDF
Introduction to SOAP/WSDL Web Services and RESTful Web Services
PDF
Introduction to SOAP
PPTX
Web Services - Architecture and SOAP (part 1)
PPTX
Web Services - WSDL
PPT
SOAP Overview
PPTX
Soap and restful webservice
WebService-Java
Simple Object Access Protocol (SOAP)
Web Service Implementation Using ASP.NET
SOAP-based Web Services
Web Services Tutorial
Soap and Rest
WebServices SOAP WSDL and UDDI
Soap vs rest
Lecture 3 soap
Introduction to SOAP
Java Web Services [3/5]: WSDL, WADL and UDDI
Web Services - A brief overview
Web services soap and rest by mandakini for TechGig
Introduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP
Web Services - Architecture and SOAP (part 1)
Web Services - WSDL
SOAP Overview
Soap and restful webservice
Ad

Similar to Web Service (20)

PDF
Networked APIs with swift
PPTX
web programming
PPTX
Web Programming
DOCX
Salesforce Integration
PDF
Xamarin Workshop Noob to Master – Week 5
PDF
Day1 : web service basics
DOCX
Web services Concepts
PPTX
PPTX
Apitesting.pptx
PDF
Session 8 Android Web Services - Part 1.pdf
PDF
Best practices and advantages of REST APIs
PDF
Rest web service
PPTX
PPT
Web services for developer
PPT
jkljklj
PPT
PDF
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
PPTX
LAJUG Napster REST API
PDF
4 Basic PHP
DOCX
Sending mail,web services
Networked APIs with swift
web programming
Web Programming
Salesforce Integration
Xamarin Workshop Noob to Master – Week 5
Day1 : web service basics
Web services Concepts
Apitesting.pptx
Session 8 Android Web Services - Part 1.pdf
Best practices and advantages of REST APIs
Rest web service
Web services for developer
jkljklj
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
LAJUG Napster REST API
4 Basic PHP
Sending mail,web services
Ad

Recently uploaded (20)

PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation theory and applications.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Cloud computing and distributed systems.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
A Presentation on Artificial Intelligence
PDF
Machine learning based COVID-19 study performance prediction
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Approach and Philosophy of On baking technology
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
KodekX | Application Modernization Development
Network Security Unit 5.pdf for BCA BBA.
CIFDAQ's Market Insight: SEC Turns Pro Crypto
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation theory and applications.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
MYSQL Presentation for SQL database connectivity
20250228 LYD VKU AI Blended-Learning.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Dropbox Q2 2025 Financial Results & Investor Presentation
Cloud computing and distributed systems.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
A Presentation on Artificial Intelligence
Machine learning based COVID-19 study performance prediction
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Approach and Philosophy of On baking technology
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Digital-Transformation-Roadmap-for-Companies.pptx
KodekX | Application Modernization Development

Web Service

  • 1. WEB SERVICES (REST / SOAP) Presented By: Ashwani (Sr. Software Engineer)
  • 2. What is Web Service lA software system designed to support communication between machine-to-machine over a network lprovide standared format of communication lPlatform independent communication Built on PHP OS: Apache Built on .NET OS: Windows
  • 3. Where we use Web Service lWeb services allows you to expose the functionality of your existing code over the network. lOnce it is exposed on the network, other application can use the functionality of your program without passing actual logic or code lCan be consider as a class and object in refrence of OOPS lLike Payment Gatway, google API, etc
  • 4. Where we can use Web Service API
  • 5. Where we can use Web Service SMS Service Organization Other Bussiness organization API Request API Response
  • 6. SOAP (Simple Object Access Protocol) REST (Representational state transfer) Type Of Web Service Web Services
  • 7. How Web Services Work lLet assume two different platform is present lOne built on PHP( app1) and other on .NET(app2) and is on diffrent server lHere we need lmedium 'HTTP' / 'Internet' protocal lFormat XML / JSON (comman format that both will understand)
  • 8. SOAP lUse Meduim 'HTTP POST' Method lFormat is always XML
  • 9. REST lUse Medium “ HTTP POST PUT GET DELETE PATCH what ever format HTTP support” lUSE FORMAT XML, JSON, Text what ever format HTTP support
  • 10. What is Restful web service lA web service which is used to communicate between clinet- server using REST Arch. / principle. lREST is an architectural style, while SOAP is a protocol. REST is not a standard in itself, but RESTful implementations make use of standards, such as HTTP, URI, JSON, and XML.
  • 11. Principle of REST Architecture lUser interface lStateless lCacheable lLayered System lCode on Demand (optional)
  • 12. User Interface 1) Resource:- Every thing is resource 2) URI:- Any resource data can accessed by URI 3) HTTP:- make use of HTTP method
  • 13. Employee - id - name Designation - id - name And many more... 1. Resource: Every thing is resource Emplyee managment system
  • 14. Employee - id - name Designation - id - name And many more....... Emplyee managment system Employe e Designatio n 1. Resource: Every thing is resource
  • 15. Employee - id - name Designation - id - name And many more....... Emplyee managment system Employee Designatio n 1. Resource: Every thing is resource Every module of project we can define As Resource
  • 16. Employee - id - name Designation - id - name And many more....... Emplyee managment system Employe e Designatio n 1. Resource: Every thing is resource 2. URI: Any Resource can be accessed by URI (Uniform Resource Identifier) For Example: www.myrest.com/designation www.myrest.com/designation/1 0 Resource URI What will be url if i want all employee having given Designation?
  • 17. Employee - id - name Designation - id - name And many more....... Emplyee managment system Employe e Designatio n 1. Resource: Every thing is resource 2. URI: Any Resource can be accessed by URI (Uniform Resource Identifier) For Example: www.myrest.com/designation www.myrest.com/designation/1 0 Resource URI www.myrest.com/designation/10/employe e
  • 18. Employee - id - name Designation - id - name And many more....... Emplyee managment system Employe e Designatio n 1. Resource: Every thing is resource 2. URI: Any Resource can be accessed by URI (Uniform Resource Identifier) For Example: www.myrest.com/designation www.myrest.com/designation/1 0 Resource URI 3. HTTP Verb VERB lGET lPOST lPUT lDELETE
  • 19. Employee - id - name Designation - id - name And many more....... Emplyee managment system Employe e Designatio n 1. Resource: Every thing is resource 2. URI: Any Resource can be accessed by URI (Uniform Resource Identifier) For Example: www.myrest.com/designation www.myrest.com/designation/1 0 Resource URI 3. HTTP Verb VERB lGET lPOST lPUT lDELETE Nam e
  • 20. Stateless : lServer does not maintatin any data of any previous request has been made lNo Session lEvery request will be independent and its client responsiblity to send all details whatever needed fro that request lFor example: Client Serve r www.apicall.com/login + POST data (uname + pass) Response: { status: success, auth token: xyz } www.apicall.com/myPayslip + authtoken (in header)
  • 21. Cachin g lThis happen at client side. Responses must therefore, implicitly or explicitly, define themselves as cacheable or not to prevent clients from reusing lstale or inappropriate data in response to further requests lWell-managed caching partially or completely eliminates some client–server interactions, further improving scalability and performance.
  • 22. Layering: A client cannot ordinarily tell whether it is connected directly to the end server, or to an intermediary along the way. Intermediary servers may improve system scalability by enabling load balancing and by providing shared caches. They may also enforce security policies. Clinet ServerProxy Cache
  • 23. REST Summary lREST is architectural Structure lWe must follow all principle of REST in order to improve performace, Portablity, Visibility, Simplicity
  • 24. Web Service Authentication lFor Authentication you can use any logic which ever seems to be secure can be used lBasic Authentication l- pass username and password in header
  • 25. Web Service Authentication(cont.) lCustom Authentation lWhen login generate token and send in response lThis will be saved in cookies and will be used to pass along with further transaction by setting this in header lCan use Oauth2 lYou can create your own authentication(can change header), it totaly depends on developer only security is concern.
  • 27. Web Service Authentication(cont.) lCustom Authentation lWhen login generate token and send in response lThis will be saved in cookies and will be used to pass along with further transaction by setting this in header lCan use Oauth2 lYou can create your own authentication(can change header), it totaly depends on developer only security is concern.
  • 28. What is SOAP lSOAP is also web service but use medium as a POST lSOAP is protocol used for exchanging data between client and server lIT uses XML technologies as a messaging. lXML -> eXtensible Markup Language. lHTML -> Hyper text Markup Language lSOAP can work on HTTP, SMTP, FTP lSOAP is platform- and language-independent lSOAP defines its own security known as WS Security.
  • 30. The SOAP Structure lA SOAP message contains 3 parts: lEnvelope: defines the content of the message lHeader (optional): contains header information lBody: contains call and response information From the http://schemas.xmlsoap.org/soap/envelope/ namespace
  • 31. SAOP Envelope The SOAP envelope indicates the start and the end of the message so that the receiver knows when an entire message has been received The Envelope is the top element of the XML document representing the message. The Envelope element is always the root element of a SOAP message. The Envelope element contains an optional Header element followed by a mandatory Body element.
  • 32. SOAP Envlope Code <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <!-- optional --> <!-- header blocks go here... --> </soap:Header> <soap:Body> <!-- payload or Fault element goes here... → </soap:Body> </soap:Envelope>
  • 35. SOAP Vs REST SOAP REST SOAP is a protocol REST is an architectural style. Standards to be strictly followed. does not define too much standards like SOAP. SOAP requires more bandwidth and resource than REST. REST requires less bandwidth and resource than SOAP. SOAP permits XML data format only. REST permits different data format such as Plain text, HTML, XML, JSON etc.