SlideShare a Scribd company logo
REpresentational State Transfer
(REST)
Tanay Sinha
Agenda
WEB SERVICES SOAP vs REST
ADVANTAGESHTTPS
HTTP Methods
Resource AugPAYLOAD
RESTFUL WEB
SERVICE
A Web Service is can be defined by following ways:
• is a client server application or application component for communication
• method of communication between two devices over network.
• is a collection of standards or protocols for exchanging information between
two devices or application.
About Web Services
• There are mainly two types of web services -
TYPES OF WEB SERVICES
SOAP
• Stands for simple object access
protocol
• SOAP is a protocol
• SOAP define standard to be strictly
followed
• SOAP can’t use REST because it a
protocol
• SOAP define xml format only
SOAP v/s REST
REST
• REST stands for Representational
State Transfer
• REST is a architectural Style
• REST doesn't define to much
standard like SOAP
• REST can use SOAP web services
because it is a concept and can use
any protocol like HTTP, SOAP.
• REST permits different data format
such as Plain text, HTML, XML,
JSON etc.
Restful Web Services
• A web service is a collection of open protocols and standards used for
exchanging data between applications or systems.
• Web services based on REST Architecture are known as RESTful Web
Services
• Rest web services use HTTP methods to implement the concept of REST
architecture. A RESTful web service usually defines a URI (Uniform
Resource Identifier), which is a service that provides resource
representation such as JSON and a set of HTTP Methods.
ADDRESSING
• Addressing refers to locating a resource or multiple resources lying on the
server.
• Each resource in REST architecture is identified by its URI (Uniform
Resource Identifier). A URI is of the following format −
• “<protocol>://<service-name>/<ResourceType>/<ResourceID>”
• Purpose of an URI is to locate a resource(s) on the server hosting the web
service.
HTTP METHOD
The following HTTP methods are most commonly used in a REST based
architecture.
▪ GET − Provides a read only access to a resource.
▪ POST − Used to create a new resource.
▪ DELETE − Used to remove a resource.
▪ PUT − Used to update an existing resource or create a new resource.
GET
• The GET method is used to retrieve information from the given server using
a given URI. Requests using GET should only retrieve data and should have
no other effect on the data.
POST
• the POST request method requests that a web server accept the data
enclosed in the body of the request message, most likely for storing it..
PUT
• Replaces all current representations of the target resource with the
uploaded content.
DELETE
• Removes all current representations of the target resource given by a URI.
STATELESSNESS
• RESTful Web Service should not keep a client state on the server. This
restriction is called Statelessness
• It is the responsibility of the client to pass its context to the server and then the
server can store this context to process the client's further request.
• Consider the following URL −
• “http://localhost:8080/UserManagement/rest/UserService/users/1”
• If you hit the above url using your browser or using a java based client or using
Postman, result will always be the User XML whose Id is 1 because the server
does not store any information about the client
• Display the Result in XML format
<user><id>1</id><name>xyz</name></user>
ADVANTAGE OF RESTFUL WEB
SERVICES
SECURITY
• As RESTful Web Services work with HTTP URL Paths, it is very important to
safeguard a RESTful Web Service in the same manner as a website is
secured.
• Following are the best practices to be adhered to while designing a RESTful
Web Service −
• Session Based Authentication − Use session based authentication to
authenticate a user whenever a request is made to a Web Service method.
• Validate Malformed XML/JSON − Check for well-formed input passed to a
web service method.
• No Sensitive Data in the URL − Never use username, password or session
token in a URL, these values should be passed to Web Service via the POST
method.
ADVANTAGE OF RESTFUL WEB
SERVICES
• The Payload section describes the data the server returns in response to a
request.
• The Payload return the data in JSON , XML or Text.
PAYLOAD
• XML Stands for eXtensible Markup Language.
• XML is a markup language much like HTML.
• XML was designed to store and transport data.
• XML uses more words than necessary
▪ Example of XML –
XML
• JSON Stands for JavaScript Object Notation.
• JSON is a syntax for Storing and exchanging data.
• JSON files are more human readable than XML.
• Example of JSON format-
JSON
Thank you
Thank You
Thankyou
GenX Info Technologies Pvt. Ltd.
411, 4th Floor, Bestech Cyber Park
National Highway-8
Gurgaon, Haryana, INDIA
www.gen-xt.com, sales@gen-xt.com
+91-124-2656001, +91-9810402267

More Related Content

What's hot

JavaScript Fetch API
JavaScript Fetch APIJavaScript Fetch API
JavaScript Fetch API
Xcat Liu
 
Api Testing
Api TestingApi Testing
Api Testing
Vishwanath KC
 
Service-mesh options with Linkerd, Consul, Istio and AWS AppMesh
Service-mesh options with Linkerd, Consul, Istio and AWS AppMeshService-mesh options with Linkerd, Consul, Istio and AWS AppMesh
Service-mesh options with Linkerd, Consul, Istio and AWS AppMesh
Christian Posta
 
ASP.NET Core Unit Testing
ASP.NET Core Unit TestingASP.NET Core Unit Testing
ASP.NET Core Unit Testing
Shahed Chowdhuri
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
Tessa Mero
 
[Russia] MySQL OOB injections
[Russia] MySQL OOB injections[Russia] MySQL OOB injections
[Russia] MySQL OOB injections
OWASP EEE
 
How To be a Backend developer
How To be a Backend developer    How To be a Backend developer
How To be a Backend developer
Ramy Hakam
 
Spring Security 5
Spring Security 5Spring Security 5
Spring Security 5
Jesus Perez Franco
 
GraphQL
GraphQLGraphQL
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
Brad Genereaux
 
Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2
Knoldus Inc.
 
Jsp(java server pages)
Jsp(java server pages)Jsp(java server pages)
Jsp(java server pages)
Khan Mac-arther
 
HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)
Gurjot Singh
 
Introduction to Basic Concepts in Web
Introduction to Basic Concepts in WebIntroduction to Basic Concepts in Web
Introduction to Basic Concepts in WebJussi Pohjolainen
 
Restful api design
Restful api designRestful api design
Restful api design
Mizan Riqzia
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
Suyash Srijan
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
Nitin Pande
 
Attribute-Based Access Control in Symfony
Attribute-Based Access Control in SymfonyAttribute-Based Access Control in Symfony
Attribute-Based Access Control in Symfony
Adam Elsodaney
 
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Express
jguerrero999
 

What's hot (20)

JavaScript Fetch API
JavaScript Fetch APIJavaScript Fetch API
JavaScript Fetch API
 
Api Testing
Api TestingApi Testing
Api Testing
 
Service-mesh options with Linkerd, Consul, Istio and AWS AppMesh
Service-mesh options with Linkerd, Consul, Istio and AWS AppMeshService-mesh options with Linkerd, Consul, Istio and AWS AppMesh
Service-mesh options with Linkerd, Consul, Istio and AWS AppMesh
 
ASP.NET Core Unit Testing
ASP.NET Core Unit TestingASP.NET Core Unit Testing
ASP.NET Core Unit Testing
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
 
[Russia] MySQL OOB injections
[Russia] MySQL OOB injections[Russia] MySQL OOB injections
[Russia] MySQL OOB injections
 
How To be a Backend developer
How To be a Backend developer    How To be a Backend developer
How To be a Backend developer
 
Spring Security 5
Spring Security 5Spring Security 5
Spring Security 5
 
GraphQL
GraphQLGraphQL
GraphQL
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2
 
WS-Privacy,
WS-Privacy,WS-Privacy,
WS-Privacy,
 
Jsp(java server pages)
Jsp(java server pages)Jsp(java server pages)
Jsp(java server pages)
 
HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)
 
Introduction to Basic Concepts in Web
Introduction to Basic Concepts in WebIntroduction to Basic Concepts in Web
Introduction to Basic Concepts in Web
 
Restful api design
Restful api designRestful api design
Restful api design
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
 
Attribute-Based Access Control in Symfony
Attribute-Based Access Control in SymfonyAttribute-Based Access Control in Symfony
Attribute-Based Access Control in Symfony
 
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Express
 

Similar to Rest webservice ppt

REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.ppt
KGSCSEPSGCT
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with OData
Mahek Merchant
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API RecommendationsJeelani Shaik
 
Rest component demo
Rest component demoRest component demo
Rest component demo
Ramakrishna kapa
 
Rest
Rest Rest
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
Ram Awadh Prasad, PMP
 
Mini-Training: Let's have a rest
Mini-Training: Let's have a restMini-Training: Let's have a rest
Mini-Training: Let's have a rest
Betclic Everest Group Tech Team
 
Overview of java web services
Overview of java web servicesOverview of java web services
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
Siddharth Sharma
 
Rest APIs Training
Rest APIs TrainingRest APIs Training
Rest APIs Training
Shekhar Kumar
 
Unit v
Unit v Unit v
Unit v
APARNA P
 
ROA.ppt
ROA.pptROA.ppt
ROA.ppt
KGSCSEPSGCT
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
Prateek Tandon
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
 
Ch 3: Web Application Technologies
Ch 3: Web Application TechnologiesCh 3: Web Application Technologies
Ch 3: Web Application Technologies
Sam Bowne
 
Ch-1_.ppt
Ch-1_.pptCh-1_.ppt
Ch-1_.ppt
berihunmolla2
 
SCWCD : The web client model
SCWCD : The web client modelSCWCD : The web client model
SCWCD : The web client model
Ben Abdallah Helmi
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service DesignLorna Mitchell
 
Restful webservice
Restful webserviceRestful webservice
Restful webservice
Dong Ngoc
 

Similar to Rest webservice ppt (20)

REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.ppt
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with OData
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
 
Rest component demo
Rest component demoRest component demo
Rest component demo
 
Rest
Rest Rest
Rest
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
 
Mini-Training: Let's have a rest
Mini-Training: Let's have a restMini-Training: Let's have a rest
Mini-Training: Let's have a rest
 
Overview of java web services
Overview of java web servicesOverview of java web services
Overview of java web services
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
 
RESTful APIs
RESTful APIsRESTful APIs
RESTful APIs
 
Rest APIs Training
Rest APIs TrainingRest APIs Training
Rest APIs Training
 
Unit v
Unit v Unit v
Unit v
 
ROA.ppt
ROA.pptROA.ppt
ROA.ppt
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Ch 3: Web Application Technologies
Ch 3: Web Application TechnologiesCh 3: Web Application Technologies
Ch 3: Web Application Technologies
 
Ch-1_.ppt
Ch-1_.pptCh-1_.ppt
Ch-1_.ppt
 
SCWCD : The web client model
SCWCD : The web client modelSCWCD : The web client model
SCWCD : The web client model
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service Design
 
Restful webservice
Restful webserviceRestful webservice
Restful webservice
 

Recently uploaded

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 

Recently uploaded (20)

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 

Rest webservice ppt

  • 2. Agenda WEB SERVICES SOAP vs REST ADVANTAGESHTTPS HTTP Methods Resource AugPAYLOAD RESTFUL WEB SERVICE
  • 3. A Web Service is can be defined by following ways: • is a client server application or application component for communication • method of communication between two devices over network. • is a collection of standards or protocols for exchanging information between two devices or application. About Web Services
  • 4. • There are mainly two types of web services - TYPES OF WEB SERVICES
  • 5. SOAP • Stands for simple object access protocol • SOAP is a protocol • SOAP define standard to be strictly followed • SOAP can’t use REST because it a protocol • SOAP define xml format only SOAP v/s REST REST • REST stands for Representational State Transfer • REST is a architectural Style • REST doesn't define to much standard like SOAP • REST can use SOAP web services because it is a concept and can use any protocol like HTTP, SOAP. • REST permits different data format such as Plain text, HTML, XML, JSON etc.
  • 6. Restful Web Services • A web service is a collection of open protocols and standards used for exchanging data between applications or systems. • Web services based on REST Architecture are known as RESTful Web Services • Rest web services use HTTP methods to implement the concept of REST architecture. A RESTful web service usually defines a URI (Uniform Resource Identifier), which is a service that provides resource representation such as JSON and a set of HTTP Methods.
  • 7. ADDRESSING • Addressing refers to locating a resource or multiple resources lying on the server. • Each resource in REST architecture is identified by its URI (Uniform Resource Identifier). A URI is of the following format − • “<protocol>://<service-name>/<ResourceType>/<ResourceID>” • Purpose of an URI is to locate a resource(s) on the server hosting the web service.
  • 8. HTTP METHOD The following HTTP methods are most commonly used in a REST based architecture. ▪ GET − Provides a read only access to a resource. ▪ POST − Used to create a new resource. ▪ DELETE − Used to remove a resource. ▪ PUT − Used to update an existing resource or create a new resource.
  • 9. GET • The GET method is used to retrieve information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data.
  • 10. POST • the POST request method requests that a web server accept the data enclosed in the body of the request message, most likely for storing it..
  • 11. PUT • Replaces all current representations of the target resource with the uploaded content.
  • 12. DELETE • Removes all current representations of the target resource given by a URI.
  • 13. STATELESSNESS • RESTful Web Service should not keep a client state on the server. This restriction is called Statelessness • It is the responsibility of the client to pass its context to the server and then the server can store this context to process the client's further request. • Consider the following URL − • “http://localhost:8080/UserManagement/rest/UserService/users/1” • If you hit the above url using your browser or using a java based client or using Postman, result will always be the User XML whose Id is 1 because the server does not store any information about the client • Display the Result in XML format <user><id>1</id><name>xyz</name></user> ADVANTAGE OF RESTFUL WEB SERVICES
  • 14. SECURITY • As RESTful Web Services work with HTTP URL Paths, it is very important to safeguard a RESTful Web Service in the same manner as a website is secured. • Following are the best practices to be adhered to while designing a RESTful Web Service − • Session Based Authentication − Use session based authentication to authenticate a user whenever a request is made to a Web Service method. • Validate Malformed XML/JSON − Check for well-formed input passed to a web service method. • No Sensitive Data in the URL − Never use username, password or session token in a URL, these values should be passed to Web Service via the POST method. ADVANTAGE OF RESTFUL WEB SERVICES
  • 15. • The Payload section describes the data the server returns in response to a request. • The Payload return the data in JSON , XML or Text. PAYLOAD
  • 16. • XML Stands for eXtensible Markup Language. • XML is a markup language much like HTML. • XML was designed to store and transport data. • XML uses more words than necessary ▪ Example of XML – XML
  • 17. • JSON Stands for JavaScript Object Notation. • JSON is a syntax for Storing and exchanging data. • JSON files are more human readable than XML. • Example of JSON format- JSON
  • 18. Thank you Thank You Thankyou GenX Info Technologies Pvt. Ltd. 411, 4th Floor, Bestech Cyber Park National Highway-8 Gurgaon, Haryana, INDIA www.gen-xt.com, sales@gen-xt.com +91-124-2656001, +91-9810402267