SlideShare a Scribd company logo
1 of 24
Download to read offline
2012 North American Advisory Forum (Miami  Florida  April 2012)

                       PANEL PRESENTATION


OpenTravel and RESTful Resources
  The rising complexity and cost of managing legacy travel
  distribution systems are leading many travel companies
  today to adopt a REST (REpresentational State Transfer)
  architectural style because it provides standardized
  resources that enable precise interaction with other REST
  systems. The panelists will discuss the fundamental shift in
  application design required to begin thinking in terms of
  resources rather than objects and methods and how the
  OpenTravel 2.0 specification is being designed to provide a
  common XML resource model for the travel industry.
2012 North American Advisory Forum (Miami  Florida  April 2012)


                    Panel Participants
RONI SCHUETZ, Enterprise Software
                                                           DAVID MORLEY, Technical Consultant,
Architect, Hewlett Packard (panelist,
                                                           Marriott International (moderator)
presenter)




DAVE HOLLANDER, Enterprise Architect, Sabre Technology (panelist)




BRYON JACOB, Chief Architect, HomeAway




STUART WALDRON, Information Technology Architect, Amtrak
OPENTRAVEL
AND RESTFUL RESOURCES
 Championed by the Web community




Roni Schuetz,
Enterprise Software Architect
OpenTravel Advisory Forum
Miami, April 2012


©2010 Hewlett-Packard Development Company, L.P.
The information contained herein is subject to change without
notice
API Stats




http://www.programmableweb.com/apis
Representational State Transfer
• Fielding captured his interpretation of the
  WWW architecture in his 2000 thesis
• Adopted by major vendors (HP, Sabre, Amtrak,
  Microsoft, Oracle, Google, Facebook, EBAY, …
  others ??)
• It’s an alternative to WS-* implementations
Do we need REST?
• We need a natural way to model resource-based
  services: that’s why we are here: OpenTravel!
• We should leverage the principles of the web on
  SOA applications
• Some WS-* are too complex and completely
  unnecessary(WS-Transfer, WS-Enumeration)
• WS-* interoperability is a big challenge for
  internet web services
• Resources provide flexible usage of common
  resources and operations which is not given by
  WS-*
REST in one slide
• Resources expose their data and functionality through resources
  identified by a unique URI
• Uniform Interface Principle: Clients interact with resources through a
  fix set of verbs
                                                              PUT
    – Example:
        •   GET – read

                                                                    R
        •   PUT – update                               GET
        •   DELETE – remove
        •   POST – create                              POST
• Multiple representations for the same resource
    – Example:                                                DELETE
        • JSON (Java Script Object Notation)
        • XML
• Hyperlinks model resource relationships and valid transfer state
  transitions for dynamic protocol description and discovery
REST Principles
• Resource based - not service based
• Addressability - name everything that matters
• Statelessness - no stateful messages exchange
  with a resource
• Relationships - expressed through links
• HTTP based
Resource based
• A resource is something “interesting” in your system
   – Can be anything
      • Spreadsheet
      • Printer
      • Inventory, Schedule, Flights
   – Others?
• Making your system Web-friendly increases its surface
  area
• You expose many resources, rather than few web
  service endpoints
• Good approach is to think in NOUN’s which appear in
  the travel domain
• The VERB’s are the actions on the noun
   – sounds familiar
HTTP based?
• REST principles are not HTTP dependent
• Typically REST should be implemented as an
  HTTP architectural style
• REST expresses dependencies on HTTP specific
  concepts such as verbs, URIs and headers
• In the future maybe non HTTP-based REST
RESTful Services best practices
•   Representation agnostic
•   Versioning
•   Service Description
•   Exception Handling
•   Security
•   Service Repository
References & Resources
•   http://www.xml.com/pub/a/2004/12/01/restful-web.html
•   http://www.infoq.com/articles/webber-rest-workflow
•   http://www.infoq.com/presentations/BPM-with-REST
•   http://books.google.ch/books?id=XUaErakHsoAC
•   http://www.soapatterns.org/atomic_service_transaction.php
•   http://www.soaprinciples.com/service_statelessness.php
GET vs. POST Retrieving Paradigm
• To retrieve a “thing” from a Resource we have
  2 options:
  – The HTTP GET options:                                    PUT
     • GET ./order/221

                                                                   R
                                                      GET
     • GET ./order?id=221
                                                      POST
  – The HTTP POST option:                                    DELETE
     • POST /order
        – id = 221 [key value] … add as much as you need!
HTTP Sample for get / post


  GET /index.html?userid=joe&password=guessme
  HTTP/1.1 Host: www.mysite.com
  User-Agent: Mozilla/4.0




  POST /login.jsp HTTP/1.1
  Host: www.mysite.com
  User-Agent: Mozilla/4.0
  Content-Length: 27
  Content-Type: application/x-www-form-urlencoded

  userid=joe&password=guessme
  Resource: http://developers.sun.com/mobility/midp/ttips/HTTPPost/
The “thing” retrieval pattern                            PUT



                                                               R
                                                   GET
• use GET and not POST
                                POST 1 + POST 2 …. POST n 
• Why not POST?
  – Overloaded POST: the not-so-RESTful pattern DELETE
  – It’s overloaded because a single HTTP method is
    being used to signify any number of non-HTTP
    methods.
  – By using POST it will happen very easy that we
    implement an RPC service. In a RPC service we are
    using post and the Action is one of it’s parameters:
    ”/orders?action=delete&id=13”
     • That’s not REST!
PUT vs. POST Creation Paradigm

• To create a new “thing” shall I use PUT or
  POST?

  There is a clear principle for this paradigm:
     • If the client is responsible for creating the ID’s of the
       “thing” use a PUT
         – E.g: “./users/roni” <- roni is unique and given by the client -
           this is a new URI!
     • If the server is responsible for creating the ID of the
       “thing” use a POST
         – E.g. “./users/” and as a post key/value the client transfers
           username=roni and prob. to id would be an auto generated
           number.
Resource naming structure pattern
Resource Name: /orders
          Action             URI Address Template                   HTTP Method
Create an order              /orders                                     POST
Get an order by given        ./orders/{id}                                GET
order id
Update an order              ./orders/{id}                                PUT
Delete an order              ./orders/{id}                               DELETE


Resource semantics:
- plural nouns (resources)
- think of a file system:
          - C:ota -> returns a list of files & folders
          - C:otadata.txt -> returns the data for this resource
-
HTTP status codes on a Resource
Resource                 Method                  Status Code                    CRUD - Action
./Orders                 POST                    200, 201, 400, 503, ….         Create
./Orders                 GET                     200, 301, 410, 503, ….         Receive
./Orders                 PUT                     200, 301, 400, 410, 503, ….    Update
./Orders                 DELETE                  200, 204, 503, ….              Delete




Status Code              Description
200                      OK
201                      Created
204                      No Content
301                      Moved Permanently
400                      Bad Request
410                      Gone
500                      Internal Server Error
501                      Not Implemented
503                      Service Unavailable

Status Code Reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
PUT
HTTP HEAD and OPTIONS                                                                                OPTIONS
There are 2 other HTTP methods which are a part of a URI:

- HEAD: Retrieve a metadata-only representation
                                                                                 GET

                                                                                 POST
                                                                                             R            HEAD
- OPTIONS: Check which HTTP methods a particular resource supports
                                                                                        DELETE
HEAD:
- making a call to a resource to fetch metadata without downloading an entire collection
- a client can use HEAD to check if a resource exists, to find out other information about the resource
without fetching it's entire representation. So we have the same functionality like a HTTP GET but now
the call does not fetch data.

OPTIONS:
- The OPTIONS method lets the client to discover what it's allowed to do to a resource. The response to
an OPTIONS request contains the HTTP Allow header, which lays out the subset of the uniform interface
this resource supports.

E.g. : Allow: GET, HEAD

That means that the client can send a GET and HEAD request to this resource but the resource does not
support any other methods - effectively, this resource is read-only.
Representations / content negotiation

  Web page with a                                       List of process input
 form to start a new                                         parameters
  process instance
                       Content Type:
                                                        Content Type:
                       text/html
                                                        application/xml


                              GET /process/name

                                                         Content Type:
                                                         application/json
      Content Type:                     Content Type:
      text/plain                        image/svg+xml


                                                           Process metadata
   Basic textutal                                               in JSON
                               Images / Pictures
 description of the
      process
API Versioning
• This concept makes it very easy to maintain
  different versions:

   –   GET /1.0/orders/ {id}
   –   GET /1.1/orders/ {id}
   –   GET /2.1/orders/ {id}
   –   GET /7.0/orders/
   –   GET /7.5/orders/

• Make your resource version visible, it’s a big part
  for resource usability
REST as a new connector

 RPC:
 Remote Procedure Call

                               REST / HTTP:
                               Representational State Transfer
                               Hypertext Transfer Protocol


                           R                                         R
 ESB:
 Enterprise Service Bus           R               R              R
                                   GET / PUT / POST / DELETE

     PUBLISH / SUBSCRIBE
Working with resources in sync mode
                  /process
                             • Client waits until the process
C                    R         is done!
 POST /process


                                                    DO SOMETHING
                                                    ON THE SERVER




         200 OK              • Block the client until the
         Execution
         done
                               execution is done

 Note: blocking & non blocking requests are supported by HTTP
Working with resources in async mode
                    /process
                               • Client starts a long running
C                   R            process
 POST /process                 • Asynchronously process
      202 ACCEPTED               between the client and the
      Location: x
                                 started process
                               • Retrieve the current state of
                                 the started process
 GET /process/x

           200 OK


 Note: blocking & non blocking requests are supported by HTTP

More Related Content

What's hot

Layouts and Rendering in Rails, Season 2
Layouts and Rendering in Rails, Season 2Layouts and Rendering in Rails, Season 2
Layouts and Rendering in Rails, Season 2RORLAB
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding RESTNitin Pande
 
Creating Truly RESTful APIs
Creating Truly RESTful APIsCreating Truly RESTful APIs
Creating Truly RESTful APIsDomenic Denicola
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsStormpath
 
Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5Michael Girouard
 
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...ruyalarcon
 
The never-ending REST API design debate -- Devoxx France 2016
The never-ending REST API design debate -- Devoxx France 2016The never-ending REST API design debate -- Devoxx France 2016
The never-ending REST API design debate -- Devoxx France 2016Restlet
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPressTaylor Lovett
 
Parsing strange v2
Parsing strange v2Parsing strange v2
Parsing strange v2Hal Stern
 
So various polymorphism in Scala
So various polymorphism in ScalaSo various polymorphism in Scala
So various polymorphism in Scalab0ris_1
 
Routing 1, Season 1
Routing 1, Season 1Routing 1, Season 1
Routing 1, Season 1RORLAB
 
Action Controller Overview, Season 2
Action Controller Overview, Season 2Action Controller Overview, Season 2
Action Controller Overview, Season 2RORLAB
 
Representational State Transfer (REST) and HATEOAS
Representational State Transfer (REST) and HATEOASRepresentational State Transfer (REST) and HATEOAS
Representational State Transfer (REST) and HATEOASGuy K. Kloss
 

What's hot (20)

Layouts and Rendering in Rails, Season 2
Layouts and Rendering in Rails, Season 2Layouts and Rendering in Rails, Season 2
Layouts and Rendering in Rails, Season 2
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
 
Creating Truly RESTful APIs
Creating Truly RESTful APIsCreating Truly RESTful APIs
Creating Truly RESTful APIs
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
 
Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5
 
Ws rest
Ws restWs rest
Ws rest
 
Develop webservice in PHP
Develop webservice in PHPDevelop webservice in PHP
Develop webservice in PHP
 
Http
HttpHttp
Http
 
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
 
The never-ending REST API design debate -- Devoxx France 2016
The never-ending REST API design debate -- Devoxx France 2016The never-ending REST API design debate -- Devoxx France 2016
The never-ending REST API design debate -- Devoxx France 2016
 
REST presentation
REST presentationREST presentation
REST presentation
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
 
Rest and Rails
Rest and RailsRest and Rails
Rest and Rails
 
Parsing strange v2
Parsing strange v2Parsing strange v2
Parsing strange v2
 
So various polymorphism in Scala
So various polymorphism in ScalaSo various polymorphism in Scala
So various polymorphism in Scala
 
REST, RESTful API
REST, RESTful APIREST, RESTful API
REST, RESTful API
 
Routing 1, Season 1
Routing 1, Season 1Routing 1, Season 1
Routing 1, Season 1
 
Action Controller Overview, Season 2
Action Controller Overview, Season 2Action Controller Overview, Season 2
Action Controller Overview, Season 2
 
Representational State Transfer (REST) and HATEOAS
Representational State Transfer (REST) and HATEOASRepresentational State Transfer (REST) and HATEOAS
Representational State Transfer (REST) and HATEOAS
 
Rest in Rails
Rest in RailsRest in Rails
Rest in Rails
 

Viewers also liked

OpenTravel Advisory Forum 2012 XML Object Suite Lab
OpenTravel Advisory Forum 2012 XML Object Suite LabOpenTravel Advisory Forum 2012 XML Object Suite Lab
OpenTravel Advisory Forum 2012 XML Object Suite LabOpenTravel Alliance
 
OpenTravel Standards from TravelTraction Berlin
OpenTravel Standards from TravelTraction BerlinOpenTravel Standards from TravelTraction Berlin
OpenTravel Standards from TravelTraction BerlinOpenTravel Alliance
 
OpenTravel XML Object Suite - Component Model
OpenTravel XML Object Suite - Component ModelOpenTravel XML Object Suite - Component Model
OpenTravel XML Object Suite - Component ModelOpenTravel Alliance
 
OpenTravel 2012 Advisory Forum Chairman Welcome
OpenTravel 2012 Advisory Forum Chairman WelcomeOpenTravel 2012 Advisory Forum Chairman Welcome
OpenTravel 2012 Advisory Forum Chairman WelcomeOpenTravel Alliance
 
Open travel 2-0_introduction_jan_2014_slideshare
Open travel 2-0_introduction_jan_2014_slideshareOpen travel 2-0_introduction_jan_2014_slideshare
Open travel 2-0_introduction_jan_2014_slideshareOpenTravel Alliance
 
OpenTravel Model-Driven Schema at IATA
OpenTravel Model-Driven Schema at IATAOpenTravel Model-Driven Schema at IATA
OpenTravel Model-Driven Schema at IATAOpenTravel Alliance
 
OpenTravel 2.0 XML Object Suite Introduction
OpenTravel 2.0 XML Object Suite IntroductionOpenTravel 2.0 XML Object Suite Introduction
OpenTravel 2.0 XML Object Suite IntroductionOpenTravel Alliance
 
OpenTravel Schema Product Comparison
OpenTravel Schema Product ComparisonOpenTravel Schema Product Comparison
OpenTravel Schema Product ComparisonOpenTravel Alliance
 
XFT Introduction at Travel Traction Berlin 2013
XFT Introduction at Travel Traction Berlin 2013XFT Introduction at Travel Traction Berlin 2013
XFT Introduction at Travel Traction Berlin 2013OpenTravel Alliance
 
OTDS presentation on Standards at Travel Traction Berlin 2013
OTDS presentation on Standards at Travel Traction Berlin 2013OTDS presentation on Standards at Travel Traction Berlin 2013
OTDS presentation on Standards at Travel Traction Berlin 2013OpenTravel Alliance
 
OpenTravel XML Object Suite Mechanics
OpenTravel XML Object Suite MechanicsOpenTravel XML Object Suite Mechanics
OpenTravel XML Object Suite MechanicsOpenTravel Alliance
 

Viewers also liked (12)

OpenTravel Advisory Forum 2012 XML Object Suite Lab
OpenTravel Advisory Forum 2012 XML Object Suite LabOpenTravel Advisory Forum 2012 XML Object Suite Lab
OpenTravel Advisory Forum 2012 XML Object Suite Lab
 
Opening Travel Traction Berlin
Opening Travel Traction BerlinOpening Travel Traction Berlin
Opening Travel Traction Berlin
 
OpenTravel Standards from TravelTraction Berlin
OpenTravel Standards from TravelTraction BerlinOpenTravel Standards from TravelTraction Berlin
OpenTravel Standards from TravelTraction Berlin
 
OpenTravel XML Object Suite - Component Model
OpenTravel XML Object Suite - Component ModelOpenTravel XML Object Suite - Component Model
OpenTravel XML Object Suite - Component Model
 
OpenTravel 2012 Advisory Forum Chairman Welcome
OpenTravel 2012 Advisory Forum Chairman WelcomeOpenTravel 2012 Advisory Forum Chairman Welcome
OpenTravel 2012 Advisory Forum Chairman Welcome
 
Open travel 2-0_introduction_jan_2014_slideshare
Open travel 2-0_introduction_jan_2014_slideshareOpen travel 2-0_introduction_jan_2014_slideshare
Open travel 2-0_introduction_jan_2014_slideshare
 
OpenTravel Model-Driven Schema at IATA
OpenTravel Model-Driven Schema at IATAOpenTravel Model-Driven Schema at IATA
OpenTravel Model-Driven Schema at IATA
 
OpenTravel 2.0 XML Object Suite Introduction
OpenTravel 2.0 XML Object Suite IntroductionOpenTravel 2.0 XML Object Suite Introduction
OpenTravel 2.0 XML Object Suite Introduction
 
OpenTravel Schema Product Comparison
OpenTravel Schema Product ComparisonOpenTravel Schema Product Comparison
OpenTravel Schema Product Comparison
 
XFT Introduction at Travel Traction Berlin 2013
XFT Introduction at Travel Traction Berlin 2013XFT Introduction at Travel Traction Berlin 2013
XFT Introduction at Travel Traction Berlin 2013
 
OTDS presentation on Standards at Travel Traction Berlin 2013
OTDS presentation on Standards at Travel Traction Berlin 2013OTDS presentation on Standards at Travel Traction Berlin 2013
OTDS presentation on Standards at Travel Traction Berlin 2013
 
OpenTravel XML Object Suite Mechanics
OpenTravel XML Object Suite MechanicsOpenTravel XML Object Suite Mechanics
OpenTravel XML Object Suite Mechanics
 

Similar to OpenTravel Advisory Forum 2012 REST XML Resources

RESTful for opentravel.org by HP
RESTful for opentravel.org by HPRESTful for opentravel.org by HP
RESTful for opentravel.org by HPRoni Schuetz
 
Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIsamesar0
 
Restful webservice
Restful webserviceRestful webservice
Restful webserviceDong Ngoc
 
So you think you know REST - DPC11
So you think you know REST - DPC11So you think you know REST - DPC11
So you think you know REST - DPC11Evert Pot
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsCarol McDonald
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
nguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-servicenguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-servicehazzaz
 
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...Nguyen Duc Phu
 
JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011Shreedhar Ganapathy
 
RESTful services
RESTful servicesRESTful services
RESTful servicesgouthamrv
 
Rest presentation
Rest  presentationRest  presentation
Rest presentationsrividhyau
 
RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座Li Yi
 
When RSS Fails: Web Scraping with HTTP
When RSS Fails: Web Scraping with HTTPWhen RSS Fails: Web Scraping with HTTP
When RSS Fails: Web Scraping with HTTPMatthew Turland
 

Similar to OpenTravel Advisory Forum 2012 REST XML Resources (20)

RESTful for opentravel.org by HP
RESTful for opentravel.org by HPRESTful for opentravel.org by HP
RESTful for opentravel.org by HP
 
Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIs
 
Restful webservice
Restful webserviceRestful webservice
Restful webservice
 
So you think you know REST - DPC11
So you think you know REST - DPC11So you think you know REST - DPC11
So you think you know REST - DPC11
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
 
Rest
RestRest
Rest
 
WebApp #3 : API
WebApp #3 : APIWebApp #3 : API
WebApp #3 : API
 
ReST
ReSTReST
ReST
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
nguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-servicenguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-service
 
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
 
Rest Webservice
Rest WebserviceRest Webservice
Rest Webservice
 
Apex REST
Apex RESTApex REST
Apex REST
 
Rest web services
Rest web servicesRest web services
Rest web services
 
JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011
 
RESTful services
RESTful servicesRESTful services
RESTful services
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 
Rest presentation
Rest  presentationRest  presentation
Rest presentation
 
RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座
 
When RSS Fails: Web Scraping with HTTP
When RSS Fails: Web Scraping with HTTPWhen RSS Fails: Web Scraping with HTTP
When RSS Fails: Web Scraping with HTTP
 

Recently uploaded

ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 

Recently uploaded (20)

ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 

OpenTravel Advisory Forum 2012 REST XML Resources

  • 1. 2012 North American Advisory Forum (Miami  Florida  April 2012) PANEL PRESENTATION OpenTravel and RESTful Resources The rising complexity and cost of managing legacy travel distribution systems are leading many travel companies today to adopt a REST (REpresentational State Transfer) architectural style because it provides standardized resources that enable precise interaction with other REST systems. The panelists will discuss the fundamental shift in application design required to begin thinking in terms of resources rather than objects and methods and how the OpenTravel 2.0 specification is being designed to provide a common XML resource model for the travel industry.
  • 2. 2012 North American Advisory Forum (Miami  Florida  April 2012) Panel Participants RONI SCHUETZ, Enterprise Software DAVID MORLEY, Technical Consultant, Architect, Hewlett Packard (panelist, Marriott International (moderator) presenter) DAVE HOLLANDER, Enterprise Architect, Sabre Technology (panelist) BRYON JACOB, Chief Architect, HomeAway STUART WALDRON, Information Technology Architect, Amtrak
  • 3. OPENTRAVEL AND RESTFUL RESOURCES Championed by the Web community Roni Schuetz, Enterprise Software Architect OpenTravel Advisory Forum Miami, April 2012 ©2010 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice
  • 5. Representational State Transfer • Fielding captured his interpretation of the WWW architecture in his 2000 thesis • Adopted by major vendors (HP, Sabre, Amtrak, Microsoft, Oracle, Google, Facebook, EBAY, … others ??) • It’s an alternative to WS-* implementations
  • 6. Do we need REST? • We need a natural way to model resource-based services: that’s why we are here: OpenTravel! • We should leverage the principles of the web on SOA applications • Some WS-* are too complex and completely unnecessary(WS-Transfer, WS-Enumeration) • WS-* interoperability is a big challenge for internet web services • Resources provide flexible usage of common resources and operations which is not given by WS-*
  • 7. REST in one slide • Resources expose their data and functionality through resources identified by a unique URI • Uniform Interface Principle: Clients interact with resources through a fix set of verbs PUT – Example: • GET – read R • PUT – update GET • DELETE – remove • POST – create POST • Multiple representations for the same resource – Example: DELETE • JSON (Java Script Object Notation) • XML • Hyperlinks model resource relationships and valid transfer state transitions for dynamic protocol description and discovery
  • 8. REST Principles • Resource based - not service based • Addressability - name everything that matters • Statelessness - no stateful messages exchange with a resource • Relationships - expressed through links • HTTP based
  • 9. Resource based • A resource is something “interesting” in your system – Can be anything • Spreadsheet • Printer • Inventory, Schedule, Flights – Others? • Making your system Web-friendly increases its surface area • You expose many resources, rather than few web service endpoints • Good approach is to think in NOUN’s which appear in the travel domain • The VERB’s are the actions on the noun – sounds familiar
  • 10. HTTP based? • REST principles are not HTTP dependent • Typically REST should be implemented as an HTTP architectural style • REST expresses dependencies on HTTP specific concepts such as verbs, URIs and headers • In the future maybe non HTTP-based REST
  • 11. RESTful Services best practices • Representation agnostic • Versioning • Service Description • Exception Handling • Security • Service Repository
  • 12. References & Resources • http://www.xml.com/pub/a/2004/12/01/restful-web.html • http://www.infoq.com/articles/webber-rest-workflow • http://www.infoq.com/presentations/BPM-with-REST • http://books.google.ch/books?id=XUaErakHsoAC • http://www.soapatterns.org/atomic_service_transaction.php • http://www.soaprinciples.com/service_statelessness.php
  • 13. GET vs. POST Retrieving Paradigm • To retrieve a “thing” from a Resource we have 2 options: – The HTTP GET options: PUT • GET ./order/221 R GET • GET ./order?id=221 POST – The HTTP POST option: DELETE • POST /order – id = 221 [key value] … add as much as you need!
  • 14. HTTP Sample for get / post GET /index.html?userid=joe&password=guessme HTTP/1.1 Host: www.mysite.com User-Agent: Mozilla/4.0 POST /login.jsp HTTP/1.1 Host: www.mysite.com User-Agent: Mozilla/4.0 Content-Length: 27 Content-Type: application/x-www-form-urlencoded userid=joe&password=guessme Resource: http://developers.sun.com/mobility/midp/ttips/HTTPPost/
  • 15. The “thing” retrieval pattern PUT R GET • use GET and not POST POST 1 + POST 2 …. POST n  • Why not POST? – Overloaded POST: the not-so-RESTful pattern DELETE – It’s overloaded because a single HTTP method is being used to signify any number of non-HTTP methods. – By using POST it will happen very easy that we implement an RPC service. In a RPC service we are using post and the Action is one of it’s parameters: ”/orders?action=delete&id=13” • That’s not REST!
  • 16. PUT vs. POST Creation Paradigm • To create a new “thing” shall I use PUT or POST? There is a clear principle for this paradigm: • If the client is responsible for creating the ID’s of the “thing” use a PUT – E.g: “./users/roni” <- roni is unique and given by the client - this is a new URI! • If the server is responsible for creating the ID of the “thing” use a POST – E.g. “./users/” and as a post key/value the client transfers username=roni and prob. to id would be an auto generated number.
  • 17. Resource naming structure pattern Resource Name: /orders Action URI Address Template HTTP Method Create an order /orders POST Get an order by given ./orders/{id} GET order id Update an order ./orders/{id} PUT Delete an order ./orders/{id} DELETE Resource semantics: - plural nouns (resources) - think of a file system: - C:ota -> returns a list of files & folders - C:otadata.txt -> returns the data for this resource -
  • 18. HTTP status codes on a Resource Resource Method Status Code CRUD - Action ./Orders POST 200, 201, 400, 503, …. Create ./Orders GET 200, 301, 410, 503, …. Receive ./Orders PUT 200, 301, 400, 410, 503, …. Update ./Orders DELETE 200, 204, 503, …. Delete Status Code Description 200 OK 201 Created 204 No Content 301 Moved Permanently 400 Bad Request 410 Gone 500 Internal Server Error 501 Not Implemented 503 Service Unavailable Status Code Reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
  • 19. PUT HTTP HEAD and OPTIONS OPTIONS There are 2 other HTTP methods which are a part of a URI: - HEAD: Retrieve a metadata-only representation GET POST R HEAD - OPTIONS: Check which HTTP methods a particular resource supports DELETE HEAD: - making a call to a resource to fetch metadata without downloading an entire collection - a client can use HEAD to check if a resource exists, to find out other information about the resource without fetching it's entire representation. So we have the same functionality like a HTTP GET but now the call does not fetch data. OPTIONS: - The OPTIONS method lets the client to discover what it's allowed to do to a resource. The response to an OPTIONS request contains the HTTP Allow header, which lays out the subset of the uniform interface this resource supports. E.g. : Allow: GET, HEAD That means that the client can send a GET and HEAD request to this resource but the resource does not support any other methods - effectively, this resource is read-only.
  • 20. Representations / content negotiation Web page with a List of process input form to start a new parameters process instance Content Type: Content Type: text/html application/xml GET /process/name Content Type: application/json Content Type: Content Type: text/plain image/svg+xml Process metadata Basic textutal in JSON Images / Pictures description of the process
  • 21. API Versioning • This concept makes it very easy to maintain different versions: – GET /1.0/orders/ {id} – GET /1.1/orders/ {id} – GET /2.1/orders/ {id} – GET /7.0/orders/ – GET /7.5/orders/ • Make your resource version visible, it’s a big part for resource usability
  • 22. REST as a new connector RPC: Remote Procedure Call REST / HTTP: Representational State Transfer Hypertext Transfer Protocol R R ESB: Enterprise Service Bus R R R GET / PUT / POST / DELETE PUBLISH / SUBSCRIBE
  • 23. Working with resources in sync mode /process • Client waits until the process C R is done! POST /process DO SOMETHING ON THE SERVER 200 OK • Block the client until the Execution done execution is done Note: blocking & non blocking requests are supported by HTTP
  • 24. Working with resources in async mode /process • Client starts a long running C R process POST /process • Asynchronously process 202 ACCEPTED between the client and the Location: x started process • Retrieve the current state of the started process GET /process/x 200 OK Note: blocking & non blocking requests are supported by HTTP