2. Jan Algermissen
“Applying the Web to Enterprise IT”
@algermissen
algermissen@acm.org
http://www.nordsc.com/blog
NORD Software Consulting
http://www.nordsc.com/
22. Manipulation of resources
through representations
Self-descriptive messages
Hypermedia as the engine of
application state
REST
Four core constraints
Identification of resources
28. GET /catalog
GET /products/667
GET /products?search=lego
POST /orders/
PUT /orders/42
DELETE /orders/42
POST /payment-notifications/
GET /orders/2009/?month=June
GET /orders/payment-pending
DELETE /accounts/bob
PUT /orders/42/state
GET
DELETE
PUT
POST
41. RPC URI-Tunneling w/GET
GET /srv/?action=getCatalog
GET /srv/?action=getDetails&productID=2213-21
GET /srv/?action=placeOrder&itemIDs=23,455,12
GET /srv/?action=changeOrder&orderId=42&newiItemId=25
GET /srv/?action=cancelOrder&orderId=42
GET /srv/?action=notifyPayment&orderId=42
GET /srv/?action=getReport&year=2009&week=34
42. RPC URI-Tunneling
POST /srv/?action=getCatalog
POST /srv/?action=getDetails&productID=2213-21
POST /srv/?action=placeOrder&itemIDs=23,455,12
POST /srv/?action=changeOrder&orderId=42&newiItemId=25
POST /srv/?action=cancelOrder&orderId=42
POST /srv/?action=notifyPayment&orderId=42
POST /srv/?action=getReport&year=2009&week=34
44. HTTP-Based Type I
GET /srv/catalog
GET /srv/products/2213-21
POST /srv/orders
PUT /srv/orders/42
DELETE /srv/orders/42
POST /srv/payment-notifications
GET /srv/reports/2009/34
Service Description:
•Fixed list of URIs
•WADL or equiv.
•Service specific XML
• Fixed, no content negotiation
47. HTTP-Based Type II
GET /srv/catalog
GET /srv/products/2213-21
POST /srv/orders
PUT /srv/orders/42
DELETE /srv/orders/42
POST /srv/payment-notifications
GET /srv/reports/2009/34
Service Description:
•Fixed list of URIs
•WADL or equiv.
•Use of ‘standard’ media types
• Fixed, no content negotiation
48. GET /srv/products/2213-21
200 Ok
Content-Type: application/vnd.oasis.ubl
<item xmlns=”...”>
<name>Lego Tower Bridge</name>
<description> ... </description>
<inStock>26</inStock>
<item>
56. Take Aways
•Network-based, decentralized creates issues.
•Constrain architectural elements to deal with issues.
•RPC URI tunneling is bad in all forms at no benefit
whatsoever.
•At least use HTTP Type I.
•HTTP Type I might be just what you need (but its not REST).