SlideShare a Scribd company logo
1 of 20
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

What's hot

The Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReSTThe Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReSTBruno Kessler Foundation
 
Rest and the hypermedia constraint
Rest and the hypermedia constraintRest and the hypermedia constraint
Rest and the hypermedia constraintInviqa
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web ServicesAngelin R
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State TransferPeter R. Egli
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)David Krmpotic
 
RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8Gajendra Sharma
 
RESTful Web Services in Drupal7
RESTful Web Services in Drupal7RESTful Web Services in Drupal7
RESTful Web Services in Drupal7bmeme
 
The Rest Architectural Style
The Rest Architectural StyleThe Rest Architectural Style
The Rest Architectural StyleRobert Wilson
 
The RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with OracleThe RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with OracleEmiliano Pecis
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUDPrem Sanil
 
RESTful services
RESTful servicesRESTful services
RESTful servicesgouthamrv
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni InturiSreeni I
 
REST API in Salesforce
REST API in SalesforceREST API in Salesforce
REST API in SalesforceVivek Deepak
 

What's hot (20)

REST, RESTful API
REST, RESTful APIREST, RESTful API
REST, RESTful API
 
The Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReSTThe Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReST
 
Rest and the hypermedia constraint
Rest and the hypermedia constraintRest and the hypermedia constraint
Rest and the hypermedia constraint
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)
 
RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8
 
JSON and REST
JSON and RESTJSON and REST
JSON and REST
 
REST API
REST APIREST API
REST API
 
RESTful Web Services in Drupal7
RESTful Web Services in Drupal7RESTful Web Services in Drupal7
RESTful Web Services in Drupal7
 
The Rest Architectural Style
The Rest Architectural StyleThe Rest Architectural Style
The Rest Architectural Style
 
The RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with OracleThe RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with Oracle
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
REST API Design
REST API DesignREST API Design
REST API Design
 
RESTful services
RESTful servicesRESTful services
RESTful services
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni Inturi
 
Soap and Rest
Soap and RestSoap and Rest
Soap and Rest
 
Rest web services
Rest web servicesRest web services
Rest web services
 
REST API in Salesforce
REST API in SalesforceREST API in Salesforce
REST API in Salesforce
 

Similar to RESTFul Web Services - Intro

Advanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIAdvanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIRasan Samarasinghe
 
Web Server-Side Programming Techniques
Web Server-Side Programming TechniquesWeb Server-Side Programming Techniques
Web Server-Side Programming Techniquesguest8899ec02
 
Native REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gNative REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gMarcelo Ochoa
 
Weekly Tech Session
Weekly Tech SessionWeekly Tech Session
Weekly Tech SessionPravin Vaja
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopJimmy Guerrero
 
Reusing Existing Java EE Applications from SOA Suite 11g
Reusing Existing Java EE Applications from SOA Suite 11gReusing Existing Java EE Applications from SOA Suite 11g
Reusing Existing Java EE Applications from SOA Suite 11gGuido Schmutz
 
Creating Restful Web Services with restish
Creating Restful Web Services with restishCreating Restful Web Services with restish
Creating Restful Web Services with restishGrig Gheorghiu
 
Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swiftTim Burks
 
Angular jS Introduction by Google
Angular jS Introduction by GoogleAngular jS Introduction by Google
Angular jS Introduction by GoogleASG
 
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...François-Guillaume Ribreau
 
Day1 : web service basics
Day1 :  web service basics Day1 :  web service basics
Day1 : web service basics Testing World
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop OverviewShubhra Kar
 
APEX, restful services and STRIPE
APEX, restful services and STRIPEAPEX, restful services and STRIPE
APEX, restful services and STRIPELino Schildenfeld
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST APIstephenbhadran
 
KaTe RESTful adapter for SAP Process Integration: Introduction
KaTe RESTful adapter for SAP Process Integration: IntroductionKaTe RESTful adapter for SAP Process Integration: Introduction
KaTe RESTful adapter for SAP Process Integration: IntroductionKate_RESTful
 
The Functional Web
The Functional WebThe Functional Web
The Functional WebRyan Riley
 

Similar to RESTFul Web Services - Intro (20)

Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
 
Advanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIAdvanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST API
 
Rest overview briefing
Rest  overview briefingRest  overview briefing
Rest overview briefing
 
Web Server-Side Programming Techniques
Web Server-Side Programming TechniquesWeb Server-Side Programming Techniques
Web Server-Side Programming Techniques
 
Native REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gNative REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11g
 
Weekly Tech Session
Weekly Tech SessionWeekly Tech Session
Weekly Tech Session
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js Workshop
 
Reusing Existing Java EE Applications from SOA Suite 11g
Reusing Existing Java EE Applications from SOA Suite 11gReusing Existing Java EE Applications from SOA Suite 11g
Reusing Existing Java EE Applications from SOA Suite 11g
 
Creating Restful Web Services with restish
Creating Restful Web Services with restishCreating Restful Web Services with restish
Creating Restful Web Services with restish
 
Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swift
 
Rest web service
Rest web serviceRest web service
Rest web service
 
Angular jS Introduction by Google
Angular jS Introduction by GoogleAngular jS Introduction by Google
Angular jS Introduction by Google
 
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
 
Day1 : web service basics
Day1 :  web service basics Day1 :  web service basics
Day1 : web service basics
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
APEX, restful services and STRIPE
APEX, restful services and STRIPEAPEX, restful services and STRIPE
APEX, restful services and STRIPE
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST API
 
KaTe RESTful adapter for SAP Process Integration: Introduction
KaTe RESTful adapter for SAP Process Integration: IntroductionKaTe RESTful adapter for SAP Process Integration: Introduction
KaTe RESTful adapter for SAP Process Integration: Introduction
 
REST Servers in Delphi XE Using DataSnap
REST Servers in Delphi XE Using DataSnapREST Servers in Delphi XE Using DataSnap
REST Servers in Delphi XE Using DataSnap
 
The Functional Web
The Functional WebThe Functional Web
The Functional Web
 

More from Manuel Correa

More from Manuel Correa (7)

How Netflix does Microservices
How Netflix does Microservices How Netflix does Microservices
How Netflix does Microservices
 
Ads final project
Ads final projectAds final project
Ads final project
 
Big table
Big tableBig table
Big table
 
Big table
Big tableBig table
Big table
 
Protocol buffers
Protocol buffersProtocol buffers
Protocol buffers
 
Optimal Adaptation
Optimal Adaptation Optimal Adaptation
Optimal Adaptation
 
Map Reduce
Map ReduceMap Reduce
Map Reduce
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

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