SlideShare une entreprise Scribd logo
1  sur  35
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
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.

Contenu connexe

Tendances

WebService-Java
WebService-JavaWebService-Java
WebService-Javahalwal
 
Simple Object Access Protocol (SOAP)
Simple Object Access Protocol (SOAP)Simple Object Access Protocol (SOAP)
Simple Object Access Protocol (SOAP)Mehul Boricha
 
Web Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NETWeb Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NETPonraj
 
WebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIWebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIRajkattamuri
 
Java Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDIJava Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDIIMC Institute
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overviewRaveendra Bhat
 
Web services soap and rest by mandakini for TechGig
Web services soap and rest by mandakini for TechGigWeb services soap and rest by mandakini for TechGig
Web services soap and rest by mandakini for TechGigMandakini Kumari
 
Introduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web ServicesIntroduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web Servicesecosio GmbH
 
Introduction to SOAP
Introduction to SOAPIntroduction to SOAP
Introduction to SOAPSafwan Hashmi
 
Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)Martin Necasky
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webserviceDong Ngoc
 

Tendances (20)

WebService-Java
WebService-JavaWebService-Java
WebService-Java
 
Simple Object Access Protocol (SOAP)
Simple Object Access Protocol (SOAP)Simple Object Access Protocol (SOAP)
Simple Object Access Protocol (SOAP)
 
Web Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NETWeb Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NET
 
SOAP-based Web Services
SOAP-based Web ServicesSOAP-based Web Services
SOAP-based Web Services
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 
Wsdl
WsdlWsdl
Wsdl
 
Soap and Rest
Soap and RestSoap and Rest
Soap and Rest
 
WebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIWebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDI
 
Soap vs rest
Soap vs restSoap vs rest
Soap vs rest
 
Lecture 3 soap
Lecture 3 soapLecture 3 soap
Lecture 3 soap
 
Introduction to SOAP
Introduction to SOAPIntroduction to SOAP
Introduction to SOAP
 
Java Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDIJava Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDI
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overview
 
Web services soap and rest by mandakini for TechGig
Web services soap and rest by mandakini for TechGigWeb services soap and rest by mandakini for TechGig
Web services soap and rest by mandakini for TechGig
 
Introduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web ServicesIntroduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web Services
 
Introduction to SOAP
Introduction to SOAPIntroduction to SOAP
Introduction to SOAP
 
Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)
 
Web Services - WSDL
Web Services - WSDLWeb Services - WSDL
Web Services - WSDL
 
SOAP Overview
SOAP OverviewSOAP Overview
SOAP Overview
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webservice
 

Similaire à Web Service

Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swiftTim Burks
 
web programming
web programmingweb programming
web programmingshreeuva
 
Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Charlin Agramonte
 
Day1 : web service basics
Day1 :  web service basics Day1 :  web service basics
Day1 : web service basics Testing World
 
Web services Concepts
Web services ConceptsWeb services Concepts
Web services Conceptspasam suresh
 
Session 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfSession 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfEngmohammedAlzared
 
Best practices and advantages of REST APIs
Best practices and advantages of REST APIsBest practices and advantages of REST APIs
Best practices and advantages of REST APIsAparna Sharma
 
Web services for developer
Web services for developerWeb services for developer
Web services for developerRafiq Ahmed
 
jkljklj
jkljkljjkljklj
jkljkljhoefo
 
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningFrequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningArul ChristhuRaj Alphonse
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST APIstephenbhadran
 
Sending mail,web services
Sending mail,web servicesSending mail,web services
Sending mail,web servicesDevang Patel
 

Similaire à Web Service (20)

Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swift
 
web programming
web programmingweb programming
web programming
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
 
Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5
 
Day1 : web service basics
Day1 :  web service basics Day1 :  web service basics
Day1 : web service basics
 
Web services Concepts
Web services ConceptsWeb services Concepts
Web services Concepts
 
Api 101
Api 101Api 101
Api 101
 
Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
 
Session 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfSession 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdf
 
Best practices and advantages of REST APIs
Best practices and advantages of REST APIsBest practices and advantages of REST APIs
Best practices and advantages of REST APIs
 
Rest web service
Rest web serviceRest web service
Rest web service
 
Day01 api
Day01   apiDay01   api
Day01 api
 
Web services for developer
Web services for developerWeb services for developer
Web services for developer
 
jkljklj
jkljkljjkljklj
jkljklj
 
Rest
RestRest
Rest
 
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningFrequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST API
 
4 Basic PHP
4 Basic PHP4 Basic PHP
4 Basic PHP
 
Sending mail,web services
Sending mail,web servicesSending mail,web services
Sending mail,web services
 

Dernier

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 

Dernier (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 

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.
  • 26.
  • 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.