SlideShare a Scribd company logo
by
Manuel Correa
RestFul Web ServicesRestFul Web Services
 REst = REpresentation State Tranfer
 RestFul is a software architectural style
 Stateless client-server architecture
 Web Services are resources identify by an URL
e.g: www.mydomain.com/stock/GOOG
What are RestFul Web Services?What are RestFul Web Services?
What are RestFul Web Services?What are RestFul Web Services?
 Application description
WSDL vs. WADL (Web Application Description Language)
 Transport Protocol
SOAP vs. HTTP
 Discovery and publishing
UDDI vs. The Web (in general any url is a resource)
What are RestFul Web Services?What are RestFul Web Services?
Comparison with SOAP Web ServicesComparison with SOAP Web Services
RestFul vs. SOAP debateRestFul vs. SOAP debate
REST SOAP
Use HTTP transport protocol SOAP over HTTP
Point to point communication Designed to distributed systems...
Simpler specification Heavy specification. To much XML
flavors
Simple implementation Harder to develop
Any HTTP client will “work” Only SOAP clients
No require client API Must generate a SOAP client
RestFul vs. SOAP debateRestFul vs. SOAP debate
 Companies are moving from SOAP web services to RestFul web
services
 RestFul web services are coming more popular because they are
simpler to implement than SOAP
 If you know HTTP you know Rest (My claim)...
 Everything you can do with restful you can do it with SOAP...
 Google Ajax API is now full restful with JSON output
 Amazon offers SOAP and Restful interfaces. 80% developers are
using REST
 Yahoo Restful API to access Yahoo Web Services
 ESRI with ArcGIS Server with Map Services (Also support SOAP)
 Does anyone knows another company that is using Rest?
Who is using Restful?Who is using Restful?
 HTTP: Hyper Text Transport Protocol
 HTTP work with two functions: REQUEST and RESPONSE (client-
server architecture)
 Works over TCP/IP generally
 A HTTP resource is identified by an URI
HTTP ReviewHTTP Review
 Request header
GET /stocks/GOOG HTTP/1.1
Accept application.xml
User-Agent Mozilla...
Accept-Language en-us
...
[BODY]
 Request methods: HEAD, GET, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT,
PATCH
HTTP Review – RequestHTTP Review – Request
 Response header
HTTP/1.1 200 OK
Server: Apache
Content-type application/xml
Content-length 155
Date Sun, 10 Oct 2010
...
[BODY]
 Response codes
1xx: informational. 2Xx: Success. 3XX: redirection. 4XX Client error. 5XX: server error.
HTTP Review – ResponseHTTP Review – Response
Restful methods – Compare with SQLRestful methods – Compare with SQL
Action SQL HTTP(Rest)
Create Insert PUT
Read Select GET
Update Update POST
Delete Delete DELETE
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<application xmlns="http://research.sun.com/wadl/2006/10">
<doc xmlns:jersey="http://jersey.dev.java.net/" jersey:generatedBy="Jersey: 1.1.4 11/10/2009 05:36 PM"/>
<resources base="http://localhost:8084/RestFulServer/resources/">
<resource path="/stock">
<resource path="/{symbol}">
<param xmlns:xs="http://www.w3.org/2001/XMLSchema" name="symbol" style="template"
type="xs:string"/>
<method id="getStock" name="GET">
<response>
<representation mediaType="application/xml"/>
<representation mediaType="application/json"/>
</response>
</method>
<method id="deleteStock" name="DELETE"/>
<method id="putStock" name="PUT"/>
<method id="postStock" name="POST">
<response>
<representation mediaType="application/xml"/>
<representation mediaType="application/json"/>
</response>
..
WADL SpecificationWADL Specification
 Application/xml
 Application/json
 Applicaton/text
 Multipart/form-data
...
Restful Response Output typesRestful Response Output types
JSONJSON ( JavaScript Object Notation)( JavaScript Object Notation)
 Lightweight inter-change format
 Language independent
 Easy for humans and machine to read
“stock”: {
"lastestTrade":"2010-10-10T16:29:23.327-04:00",
"name":"Google Inc.",
"price":"415.5",
"symbol":"GOOG",
"volume":"200"
}
Stock.name = “GOOG”
http://www.json.org/
 RESTFul Services
◦ JAX-RS 1.0 (JSR 311)
◦ Jersey framework
 Client side
◦ JavaScript (JQuery 1.2)
◦ Java (HttpClient)
◦ Curl
◦ Any software/framework that supports HTTP and XML, JSON as response.
 Others technologies (Server Side)
◦ Spring Framework 2.5 (Context of the Web Application )
◦ Hibernate/JPA (ORM to map the database – Model of the Application)
◦ Oracle 10g
RestFul Java APIRestFul Java API
 JAX-RS: Java specification for RestFul Web Services (JSR 311)
 JAX-RS provides a set of Java annotations that allows you to annotate your
POJO and give the Restful behavior
Restful implementation in JavaRestful implementation in Java
Annotation Description
@Path URI description
@GET, @POST, @PUT,
@DELETE
Method description. Use of java methods to denote how to acces
them
@Produces, @Consumes Define what is produced when a method is invoked. Consumes
define what is allow in the input
@PathParam Parameter in the URI. eg. /stock/{symbol}
@QueryParam Parameter /stock/GOOG?hidePrice=true
 Jersey: Java Framework that implements JAX-RS
 Servlet base framework
https://jersey.dev.java.net/
Restful implementation in JavaRestful implementation in Java

NetBeans 6.8

Apache tomcat 6

Jersey and JAX-RS

Application demo: Stocks information
RestFul Web Services - DEMORestFul Web Services - DEMO
DEMO
RestFul Web ServicesRestFul Web Services
Questions ?
RestFul Web ServicesRestFul Web Services

More Related Content

PPT
Introduction to REST and the Restlet Framework
PDF
From Open Source to Open API with Restlet
PPTX
RESTful Architecture
PDF
What is REST API? REST API Concepts and Examples | Edureka
PPTX
PPTX
RESTEasy
PPTX
Rest presentation
PPTX
REST & RESTful Web Services
Introduction to REST and the Restlet Framework
From Open Source to Open API with Restlet
RESTful Architecture
What is REST API? REST API Concepts and Examples | Edureka
RESTEasy
Rest presentation
REST & RESTful Web Services

What's hot (20)

PDF
REST, RESTful API
ODP
The Internet as Web Services: introduction to ReST
KEY
Rest and the hypermedia constraint
PDF
Restful Web Services
PDF
REST - Representational State Transfer
PPTX
An Introduction To REST API
PDF
Representational State Transfer (REST)
PPTX
RestFul Web Services In Drupal 8
PPTX
JSON and REST
PPTX
REST API
PDF
RESTful Web Services in Drupal7
PPT
The Rest Architectural Style
PPT
The RESTful Soa Datagrid with Oracle
PDF
REST API and CRUD
PPTX
REST API Design
PPT
RESTful services
PDF
Restful web services by Sreeni Inturi
PPT
Soap and Rest
PDF
Rest web services
PPTX
REST API in Salesforce
REST, RESTful API
The Internet as Web Services: introduction to ReST
Rest and the hypermedia constraint
Restful Web Services
REST - Representational State Transfer
An Introduction To REST API
Representational State Transfer (REST)
RestFul Web Services In Drupal 8
JSON and REST
REST API
RESTful Web Services in Drupal7
The Rest Architectural Style
The RESTful Soa Datagrid with Oracle
REST API and CRUD
REST API Design
RESTful services
Restful web services by Sreeni Inturi
Soap and Rest
Rest web services
REST API in Salesforce
Ad

Similar to RESTFul Web Services - Intro (20)

PPSX
Advanced Web Development in PHP - Understanding REST API
PPTX
Rest overview briefing
ODP
Web Server-Side Programming Techniques
PDF
Native REST Web Services with Oracle 11g
PPTX
Weekly Tech Session
PDF
Seattle StrongLoop Node.js Workshop
PPT
Reusing Existing Java EE Applications from SOA Suite 11g
PDF
Creating Restful Web Services with restish
PDF
Networked APIs with swift
PDF
Rest web service
PPTX
Angular jS Introduction by Google
 
PDF
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
PDF
Day1 : web service basics
PPTX
StrongLoop Overview
PPT
APEX, restful services and STRIPE
PPTX
LAJUG Napster REST API
PPT
KaTe RESTful adapter for SAP Process Integration: Introduction
PDF
REST Servers in Delphi XE Using DataSnap
PPTX
The Functional Web
Advanced Web Development in PHP - Understanding REST API
Rest overview briefing
Web Server-Side Programming Techniques
Native REST Web Services with Oracle 11g
Weekly Tech Session
Seattle StrongLoop Node.js Workshop
Reusing Existing Java EE Applications from SOA Suite 11g
Creating Restful Web Services with restish
Networked APIs with swift
Rest web service
Angular jS Introduction by Google
 
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
Day1 : web service basics
StrongLoop Overview
APEX, restful services and STRIPE
LAJUG Napster REST API
KaTe RESTful adapter for SAP Process Integration: Introduction
REST Servers in Delphi XE Using DataSnap
The Functional Web
Ad

More from Manuel Correa (7)

PDF
How Netflix does Microservices
PPTX
Ads final project
PPT
Big table
ODP
Big table
PPTX
Protocol buffers
PDF
Optimal Adaptation
PPT
Map Reduce
How Netflix does Microservices
Ads final project
Big table
Big table
Protocol buffers
Optimal Adaptation
Map Reduce

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
cuic standard and advanced reporting.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
KodekX | Application Modernization Development
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Advanced IT Governance
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Modernizing your data center with Dell and AMD
“AI and Expert System Decision Support & Business Intelligence Systems”
Review of recent advances in non-invasive hemoglobin estimation
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
GamePlan Trading System Review: Professional Trader's Honest Take
Reach Out and Touch Someone: Haptics and Empathic Computing
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
cuic standard and advanced reporting.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Network Security Unit 5.pdf for BCA BBA.
KodekX | Application Modernization Development
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Advanced IT Governance
Mobile App Security Testing_ A Comprehensive Guide.pdf
Modernizing your data center with Dell and AMD

RESTFul Web Services - Intro

  • 1. by Manuel Correa RestFul Web ServicesRestFul Web Services
  • 2.  REst = REpresentation State Tranfer  RestFul is a software architectural style  Stateless client-server architecture  Web Services are resources identify by an URL e.g: www.mydomain.com/stock/GOOG What are RestFul Web Services?What are RestFul Web Services?
  • 3. What are RestFul Web Services?What are RestFul Web Services?
  • 4.  Application description WSDL vs. WADL (Web Application Description Language)  Transport Protocol SOAP vs. HTTP  Discovery and publishing UDDI vs. The Web (in general any url is a resource) What are RestFul Web Services?What are RestFul Web Services? Comparison with SOAP Web ServicesComparison with SOAP Web Services
  • 5. RestFul vs. SOAP debateRestFul vs. SOAP debate REST SOAP Use HTTP transport protocol SOAP over HTTP Point to point communication Designed to distributed systems... Simpler specification Heavy specification. To much XML flavors Simple implementation Harder to develop Any HTTP client will “work” Only SOAP clients No require client API Must generate a SOAP client
  • 6. RestFul vs. SOAP debateRestFul vs. SOAP debate  Companies are moving from SOAP web services to RestFul web services  RestFul web services are coming more popular because they are simpler to implement than SOAP  If you know HTTP you know Rest (My claim)...  Everything you can do with restful you can do it with SOAP...
  • 7.  Google Ajax API is now full restful with JSON output  Amazon offers SOAP and Restful interfaces. 80% developers are using REST  Yahoo Restful API to access Yahoo Web Services  ESRI with ArcGIS Server with Map Services (Also support SOAP)  Does anyone knows another company that is using Rest? Who is using Restful?Who is using Restful?
  • 8.  HTTP: Hyper Text Transport Protocol  HTTP work with two functions: REQUEST and RESPONSE (client- server architecture)  Works over TCP/IP generally  A HTTP resource is identified by an URI HTTP ReviewHTTP Review
  • 9.  Request header GET /stocks/GOOG HTTP/1.1 Accept application.xml User-Agent Mozilla... Accept-Language en-us ... [BODY]  Request methods: HEAD, GET, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH HTTP Review – RequestHTTP Review – Request
  • 10.  Response header HTTP/1.1 200 OK Server: Apache Content-type application/xml Content-length 155 Date Sun, 10 Oct 2010 ... [BODY]  Response codes 1xx: informational. 2Xx: Success. 3XX: redirection. 4XX Client error. 5XX: server error. HTTP Review – ResponseHTTP Review – Response
  • 11. Restful methods – Compare with SQLRestful methods – Compare with SQL Action SQL HTTP(Rest) Create Insert PUT Read Select GET Update Update POST Delete Delete DELETE
  • 12. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <application xmlns="http://research.sun.com/wadl/2006/10"> <doc xmlns:jersey="http://jersey.dev.java.net/" jersey:generatedBy="Jersey: 1.1.4 11/10/2009 05:36 PM"/> <resources base="http://localhost:8084/RestFulServer/resources/"> <resource path="/stock"> <resource path="/{symbol}"> <param xmlns:xs="http://www.w3.org/2001/XMLSchema" name="symbol" style="template" type="xs:string"/> <method id="getStock" name="GET"> <response> <representation mediaType="application/xml"/> <representation mediaType="application/json"/> </response> </method> <method id="deleteStock" name="DELETE"/> <method id="putStock" name="PUT"/> <method id="postStock" name="POST"> <response> <representation mediaType="application/xml"/> <representation mediaType="application/json"/> </response> .. WADL SpecificationWADL Specification
  • 13.  Application/xml  Application/json  Applicaton/text  Multipart/form-data ... Restful Response Output typesRestful Response Output types
  • 14. JSONJSON ( JavaScript Object Notation)( JavaScript Object Notation)  Lightweight inter-change format  Language independent  Easy for humans and machine to read “stock”: { "lastestTrade":"2010-10-10T16:29:23.327-04:00", "name":"Google Inc.", "price":"415.5", "symbol":"GOOG", "volume":"200" } Stock.name = “GOOG” http://www.json.org/
  • 15.  RESTFul Services ◦ JAX-RS 1.0 (JSR 311) ◦ Jersey framework  Client side ◦ JavaScript (JQuery 1.2) ◦ Java (HttpClient) ◦ Curl ◦ Any software/framework that supports HTTP and XML, JSON as response.  Others technologies (Server Side) ◦ Spring Framework 2.5 (Context of the Web Application ) ◦ Hibernate/JPA (ORM to map the database – Model of the Application) ◦ Oracle 10g RestFul Java APIRestFul Java API
  • 16.  JAX-RS: Java specification for RestFul Web Services (JSR 311)  JAX-RS provides a set of Java annotations that allows you to annotate your POJO and give the Restful behavior Restful implementation in JavaRestful implementation in Java Annotation Description @Path URI description @GET, @POST, @PUT, @DELETE Method description. Use of java methods to denote how to acces them @Produces, @Consumes Define what is produced when a method is invoked. Consumes define what is allow in the input @PathParam Parameter in the URI. eg. /stock/{symbol} @QueryParam Parameter /stock/GOOG?hidePrice=true
  • 17.  Jersey: Java Framework that implements JAX-RS  Servlet base framework https://jersey.dev.java.net/ Restful implementation in JavaRestful implementation in Java
  • 18.  NetBeans 6.8  Apache tomcat 6  Jersey and JAX-RS  Application demo: Stocks information RestFul Web Services - DEMORestFul Web Services - DEMO
  • 20. Questions ? RestFul Web ServicesRestFul Web Services