SlideShare a Scribd company logo
1 of 20
Presentation on
Web Services- REST Architecture
Sarwajit Kumar
What are the Web Services ?
2
❖ Application Programming Interfaces (API)
❖ Request Services
❖ REST Architecture
❖ SOA Architecture
❖ OASIS
❖ World Wide Web Consortium (W3C )
What is “Web Services” ?
3
❖ Web Services are evolving, middleware platform that facilitate program-to-program
interactions.
❖ A service is a software entity that can be discovered and invoked by other software
systems.
❖ Definition from standardization body W3C :
➢ A Web service is a software system identified by a URI, whose public interfaces
and bindings are defined and described using XML. Its definition can be
discovered by other software systems.These systems may then interact with the
Web service in a manner prescribed by its definition, using XML based
messages conveyed by internet protocols.
❖ Web services are self contained, self describing, modular applications that can be
published, located, and invoked across the web. Web services perform functions,
which can be anything from simple requests to complicated business processes".
4
Example : Web-Based Purchase
5
How does a Web Service Work ?
❖ The client sends a request
❖ Request encoded in XML
❖ Function (GET, POST…) in the file
❖ The server decodes the file
❖ The function is executed
❖ A new XML file is encoded and re-send to the
client
❖ Clients and servers communicate over the
HyperText Transfer Protocol (HTTP).
6
Types of Web Services
❖ Can be classified as “Big” web services and “RESTful” web services.
❖ “Big” web services are based on SOAP standard and often contain a WSDL to describe
the interface that the web service offers.
❖ “Big” web services includes architecture to address complex non-functional
requirements like transactions, security, addressing, trust, coordination, and also
handles asynchronous processing and invocation.
❖ SOAP based Web Services is a great solution when you need,
➢ Asynchronous processing
➢ Reliability
➢ Stateful operations
7
RESTful Web Services
❖ REST is a term coined by Roy Fielding to describe an architecture style of networked
systems. REST is an acronym standing for Representational State Transfer.
❖ It is an architectural pattern for developing web services as opposed to a specification.
"Representational State Transfer is intended to evoke an image of how a well-designed
Web application behaves: a network of web pages (a virtual state-machine), where the
user progresses through an application by selecting links (state transitions), resulting in the
next page (representing the next state of the application) being transferred to the user and
rendered for their use."
Roy Fielding...
❖ REST web services communicate over the HTTP specification, using HTTP
vocabulary:
➢ Methods (GET, POST, etc.)
➢ HTTP URI syntax (paths, parameters, etc.)
➢ Media types (xml, json, html, plain text, etc)
➢ HTTP Response codes.
8
Introduction to REST
❖ Representational
➢ Clients possess the information necessary to identify, modify, and/or delete a web
resource.
❖ State
➢ All resource state information is stored on the client.
❖ Transfer
➢ Client state is passed from the client to the service through HTTP.
❖ The six characteristics of REST:
➢ Uniform interface
➢ Decoupled client-server interaction
➢ Stateless
➢ Cacheable
➢ Layered
➢ Extensible through code on demand (optional).
* Services that do not conform to the above required constraints are not strictly
RESTful web services.
Example : Web-Based Reservation Service
9
❖ Suppose now the airline (AirIndia.com) wants to provide a Web reservation service for
customers to make flight reservations through the Web.
❖ There are two main approaches to implementing the Web reservation service.
Approach 1
One-Stop Shopping
Continued...
10
Approach 1 Diadvantages :
❖ There is currently no industry accepted practice (rules) for expressing priorities.
❖ It violates Tim Berners-Lee Web Design, Axiom 0 (all resources on the Web must be
uniquely identified with a URI).
Approach 2:
URLs are Cheap! Use Them!
11
Continued...
Approach 2 Advantages :
❖ The different URLs are discoverable by search engines and UDDI registries.
❖ There is no need to introduce rules. Priorities are elevated to the level of a URL. "What
you see is what you get."
❖ It's easy to understand what each service does simply by examining the URL, i.e., it
exploits the Principle of Least Surprise.
❖ It's easy to implement high priority - simply assign a fast machine at the premier
member URL.
❖ There is no bottleneck and consistent with Axiom 0.
12
RESTful Web Services : HTTP and REST
HTTP-REST Request Basics
❖ The HTTP request is sent from the client.
➢ Identifies the location of a resource.
➢ Specifies the verb, or HTTP method to use when accessing the resource.
➢ Supplies optional request headers (name-value pairs) that provide additional
information the server may need when processing the request.
➢ Supplies an optional request body that identifies additional data to be uploaded to
the server
HTTP-REST Request Basics
❖ The HTTP response is sent from the server.
➢ Gives the status of the processed request.
13
Continued...
➢ Supplies response headers (name-value pairs) that provide additional information
about the response.
➢ Supplies an optional response body that identifies additional data to be
downloaded to the client
❖ A REST service framework provides a controller for routing HTTP requests to a request
handler according to:
➢ The HTTP method used (e.g. GET, POST)
➢ Supplied path information (e.g /service/listItems)
➢ Query, form, and path parameters
➢ Headers, cookies, etc.
14
Main Concepts
Nouns (Resources)
unconstrained
i.e., http://example.com/employees/12345
REST
Verbs
constrained
i.e., GET
Representations
constrained
i.e., XML
Resources
15
❖ The key abstraction of information in REST is a resource.
❖ A resource is a conceptual mapping to a set of entities
❖ Represented with a global identifier (URI in HTTP)
➢ http://www.boeing.com/aircraft/747
❖ REST uses URI to identify resources
➢ http://localhost/classes
➢ http://localhost/classes/cs2650
➢ http://localhost/classes/cs2650/students
❖ As we traverse the path from more generic to more specific, we are navigating the
data.
16
Verbs
❖ Represent the actions to be performed on resources
➢ HTTP GET
■ How clients ask for the information they seek.
➢ HTTP POST
■ HTTP POST creates a resource
➢ HTTP PUT
■ HTTP PUT updates a resource
➢ HTTP DELETE
■ Removes the resource identified by the URI
17
Representations
❖ How data is represented or returned to the client for presentation
❖ Two main formats:
➢ JavaScript Object Notation (JSON)
➢ XML
❖ It is common to have multiple representations of the same data
❖ XML
➢ <COURSE>
<ID>CS2650</ID>
<NAME>Distributed Multimedia Software</NAME>
</COURSE>
❖ JSON
➢ {course
{id: CS2650}
{name: Distributed Multimedia Sofware}
}
18
Why is it called "Representational State Transfer"?
Client
Resource
http://www.airindia.com/aircraft/111
Fuel requirements
Maintenance schedule
...
airindia111.html
REST way of Implementing the Web Services
19
Thank You

More Related Content

What's hot

Introduction to web services
Introduction to web servicesIntroduction to web services
Introduction to web servicesNitin Kumar Yadav
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webserviceDong Ngoc
 
Java Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesJava Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesIMC Institute
 
Introductiontowebarchitecture 090922221506-phpapp01
Introductiontowebarchitecture 090922221506-phpapp01Introductiontowebarchitecture 090922221506-phpapp01
Introductiontowebarchitecture 090922221506-phpapp01Maisha Price
 
Web Services
Web ServicesWeb Services
Web ServicesKrish
 
RESTful API by abubakar
RESTful API by abubakarRESTful API by abubakar
RESTful API by abubakarKenAndTea
 
Description of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDIDescription of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDITUSHAR VARSHNEY
 
Soa 8 soa technologies for web services
Soa 8 soa technologies for web servicesSoa 8 soa technologies for web services
Soa 8 soa technologies for web servicesVaibhav Khanna
 
RESTful web
RESTful webRESTful web
RESTful webAlvin Qi
 
WebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIWebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIRajkattamuri
 
Service Oriented Architecture Luqman
Service Oriented Architecture LuqmanService Oriented Architecture Luqman
Service Oriented Architecture LuqmanLuqman Shareef
 
Cloud computing by Luqman
Cloud computing by LuqmanCloud computing by Luqman
Cloud computing by LuqmanLuqman Shareef
 

What's hot (20)

Web services
Web servicesWeb services
Web services
 
Web services
Web servicesWeb services
Web services
 
Web service
Web serviceWeb service
Web service
 
Introduction to web services
Introduction to web servicesIntroduction to web services
Introduction to web services
 
Web Services
Web ServicesWeb Services
Web Services
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webservice
 
Web service introduction
Web service introductionWeb service introduction
Web service introduction
 
Java Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesJava Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web Services
 
Introductiontowebarchitecture 090922221506-phpapp01
Introductiontowebarchitecture 090922221506-phpapp01Introductiontowebarchitecture 090922221506-phpapp01
Introductiontowebarchitecture 090922221506-phpapp01
 
Web Services
Web ServicesWeb Services
Web Services
 
RESTful API by abubakar
RESTful API by abubakarRESTful API by abubakar
RESTful API by abubakar
 
Description of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDIDescription of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDI
 
Json web tokens
Json web tokensJson web tokens
Json web tokens
 
Web Service
Web ServiceWeb Service
Web Service
 
Soa 8 soa technologies for web services
Soa 8 soa technologies for web servicesSoa 8 soa technologies for web services
Soa 8 soa technologies for web services
 
RESTful web
RESTful webRESTful web
RESTful web
 
WebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIWebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDI
 
Service Oriented Architecture Luqman
Service Oriented Architecture LuqmanService Oriented Architecture Luqman
Service Oriented Architecture Luqman
 
Cloud computing by Luqman
Cloud computing by LuqmanCloud computing by Luqman
Cloud computing by Luqman
 
Web services for banks
Web services for banksWeb services for banks
Web services for banks
 

Similar to REST Web Services Presentation

REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.pptKGSCSEPSGCT
 
Secc tutorials development and deployment of rest web services in java_v2.0
Secc tutorials development and deployment of rest web services in java_v2.0Secc tutorials development and deployment of rest web services in java_v2.0
Secc tutorials development and deployment of rest web services in java_v2.0Aravindharamanan S
 
API & Backend Integration
API & Backend IntegrationAPI & Backend Integration
API & Backend IntegrationElewayte
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?Aparna Sharma
 
Web2 0 Incredibles
Web2 0 IncrediblesWeb2 0 Incredibles
Web2 0 Incrediblesanjeshdubey
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET Journal
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIsKnoldus Inc.
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesWebStackAcademy
 
Restful web-services
Restful web-servicesRestful web-services
Restful web-servicesrporwal
 
World wide web architecture presentation
World wide web architecture presentationWorld wide web architecture presentation
World wide web architecture presentationImMe Khan
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State TransferPeter R. Egli
 

Similar to REST Web Services Presentation (20)

REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.ppt
 
Secc tutorials development and deployment of rest web services in java_v2.0
Secc tutorials development and deployment of rest web services in java_v2.0Secc tutorials development and deployment of rest web services in java_v2.0
Secc tutorials development and deployment of rest web services in java_v2.0
 
Restful webservices
Restful webservicesRestful webservices
Restful webservices
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
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
 
API & Backend Integration
API & Backend IntegrationAPI & Backend Integration
API & Backend Integration
 
Treinamento 1
Treinamento 1Treinamento 1
Treinamento 1
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?
 
Web2 0 Incredibles
Web2 0 IncrediblesWeb2 0 Incredibles
Web2 0 Incredibles
 
Study of http
Study of httpStudy of http
Study of http
 
ReSTful API Final
ReSTful API FinalReSTful API Final
ReSTful API Final
 
Ch-1_.ppt
Ch-1_.pptCh-1_.ppt
Ch-1_.ppt
 
Lab7 paper
Lab7 paperLab7 paper
Lab7 paper
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce Site
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 
Restful web-services
Restful web-servicesRestful web-services
Restful web-services
 
World wide web architecture presentation
World wide web architecture presentationWorld wide web architecture presentation
World wide web architecture presentation
 
Rest
Rest Rest
Rest
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
 

REST Web Services Presentation

  • 1. Presentation on Web Services- REST Architecture Sarwajit Kumar
  • 2. What are the Web Services ? 2 ❖ Application Programming Interfaces (API) ❖ Request Services ❖ REST Architecture ❖ SOA Architecture ❖ OASIS ❖ World Wide Web Consortium (W3C )
  • 3. What is “Web Services” ? 3 ❖ Web Services are evolving, middleware platform that facilitate program-to-program interactions. ❖ A service is a software entity that can be discovered and invoked by other software systems. ❖ Definition from standardization body W3C : ➢ A Web service is a software system identified by a URI, whose public interfaces and bindings are defined and described using XML. Its definition can be discovered by other software systems.These systems may then interact with the Web service in a manner prescribed by its definition, using XML based messages conveyed by internet protocols. ❖ Web services are self contained, self describing, modular applications that can be published, located, and invoked across the web. Web services perform functions, which can be anything from simple requests to complicated business processes".
  • 5. 5 How does a Web Service Work ? ❖ The client sends a request ❖ Request encoded in XML ❖ Function (GET, POST…) in the file ❖ The server decodes the file ❖ The function is executed ❖ A new XML file is encoded and re-send to the client ❖ Clients and servers communicate over the HyperText Transfer Protocol (HTTP).
  • 6. 6 Types of Web Services ❖ Can be classified as “Big” web services and “RESTful” web services. ❖ “Big” web services are based on SOAP standard and often contain a WSDL to describe the interface that the web service offers. ❖ “Big” web services includes architecture to address complex non-functional requirements like transactions, security, addressing, trust, coordination, and also handles asynchronous processing and invocation. ❖ SOAP based Web Services is a great solution when you need, ➢ Asynchronous processing ➢ Reliability ➢ Stateful operations
  • 7. 7 RESTful Web Services ❖ REST is a term coined by Roy Fielding to describe an architecture style of networked systems. REST is an acronym standing for Representational State Transfer. ❖ It is an architectural pattern for developing web services as opposed to a specification. "Representational State Transfer is intended to evoke an image of how a well-designed Web application behaves: a network of web pages (a virtual state-machine), where the user progresses through an application by selecting links (state transitions), resulting in the next page (representing the next state of the application) being transferred to the user and rendered for their use." Roy Fielding... ❖ REST web services communicate over the HTTP specification, using HTTP vocabulary: ➢ Methods (GET, POST, etc.) ➢ HTTP URI syntax (paths, parameters, etc.) ➢ Media types (xml, json, html, plain text, etc) ➢ HTTP Response codes.
  • 8. 8 Introduction to REST ❖ Representational ➢ Clients possess the information necessary to identify, modify, and/or delete a web resource. ❖ State ➢ All resource state information is stored on the client. ❖ Transfer ➢ Client state is passed from the client to the service through HTTP. ❖ The six characteristics of REST: ➢ Uniform interface ➢ Decoupled client-server interaction ➢ Stateless ➢ Cacheable ➢ Layered ➢ Extensible through code on demand (optional). * Services that do not conform to the above required constraints are not strictly RESTful web services.
  • 9. Example : Web-Based Reservation Service 9 ❖ Suppose now the airline (AirIndia.com) wants to provide a Web reservation service for customers to make flight reservations through the Web. ❖ There are two main approaches to implementing the Web reservation service. Approach 1 One-Stop Shopping
  • 10. Continued... 10 Approach 1 Diadvantages : ❖ There is currently no industry accepted practice (rules) for expressing priorities. ❖ It violates Tim Berners-Lee Web Design, Axiom 0 (all resources on the Web must be uniquely identified with a URI). Approach 2: URLs are Cheap! Use Them!
  • 11. 11 Continued... Approach 2 Advantages : ❖ The different URLs are discoverable by search engines and UDDI registries. ❖ There is no need to introduce rules. Priorities are elevated to the level of a URL. "What you see is what you get." ❖ It's easy to understand what each service does simply by examining the URL, i.e., it exploits the Principle of Least Surprise. ❖ It's easy to implement high priority - simply assign a fast machine at the premier member URL. ❖ There is no bottleneck and consistent with Axiom 0.
  • 12. 12 RESTful Web Services : HTTP and REST HTTP-REST Request Basics ❖ The HTTP request is sent from the client. ➢ Identifies the location of a resource. ➢ Specifies the verb, or HTTP method to use when accessing the resource. ➢ Supplies optional request headers (name-value pairs) that provide additional information the server may need when processing the request. ➢ Supplies an optional request body that identifies additional data to be uploaded to the server HTTP-REST Request Basics ❖ The HTTP response is sent from the server. ➢ Gives the status of the processed request.
  • 13. 13 Continued... ➢ Supplies response headers (name-value pairs) that provide additional information about the response. ➢ Supplies an optional response body that identifies additional data to be downloaded to the client ❖ A REST service framework provides a controller for routing HTTP requests to a request handler according to: ➢ The HTTP method used (e.g. GET, POST) ➢ Supplied path information (e.g /service/listItems) ➢ Query, form, and path parameters ➢ Headers, cookies, etc.
  • 14. 14 Main Concepts Nouns (Resources) unconstrained i.e., http://example.com/employees/12345 REST Verbs constrained i.e., GET Representations constrained i.e., XML
  • 15. Resources 15 ❖ The key abstraction of information in REST is a resource. ❖ A resource is a conceptual mapping to a set of entities ❖ Represented with a global identifier (URI in HTTP) ➢ http://www.boeing.com/aircraft/747 ❖ REST uses URI to identify resources ➢ http://localhost/classes ➢ http://localhost/classes/cs2650 ➢ http://localhost/classes/cs2650/students ❖ As we traverse the path from more generic to more specific, we are navigating the data.
  • 16. 16 Verbs ❖ Represent the actions to be performed on resources ➢ HTTP GET ■ How clients ask for the information they seek. ➢ HTTP POST ■ HTTP POST creates a resource ➢ HTTP PUT ■ HTTP PUT updates a resource ➢ HTTP DELETE ■ Removes the resource identified by the URI
  • 17. 17 Representations ❖ How data is represented or returned to the client for presentation ❖ Two main formats: ➢ JavaScript Object Notation (JSON) ➢ XML ❖ It is common to have multiple representations of the same data ❖ XML ➢ <COURSE> <ID>CS2650</ID> <NAME>Distributed Multimedia Software</NAME> </COURSE> ❖ JSON ➢ {course {id: CS2650} {name: Distributed Multimedia Sofware} }
  • 18. 18 Why is it called "Representational State Transfer"? Client Resource http://www.airindia.com/aircraft/111 Fuel requirements Maintenance schedule ... airindia111.html
  • 19. REST way of Implementing the Web Services 19