REST in the shade of WCF

2,476 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,476
On SlideShare
0
From Embeds
0
Number of Embeds
198
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

REST in the shade of WCF

  1. 1. WCF Web APIs<br />REST in the shade of WCF<br />
  2. 2. Agenda<br />Co to jest REST?<br />Powrtórka z HTTP<br />Architektura WCF Web APIs<br />POST, GET, href, PUT, DELETE<br />Przykładowa architektura aplikacji RESTowej<br />Meta-dane<br />
  3. 3. REST<br />Client - server<br />Stateless<br />Cacheable<br />Layered<br />Uniform interface<br />
  4. 4. Request<br />GET /index.html<br />Host: www.example.com<br />Response<br />HTTP/1.1 200 OK<br />Date: Mon, 23 May 2005 22:38:34 GMT<br />Server: Apache/1.3.3.7<br />Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT<br />Etag: „3f80f-1b6-3e1cb03b”<br />Content-Length: 438<br />Content-Type: text/html; charset=UTF-8<br />
  5. 5. WCF Web APIs<br />WCF<br />Processor #2<br />Resource (POCO)<br />Processor #1<br />
  6. 6. Client<br />Service<br />POST /order HTTP/1.1<br />Host: restbucks.net<br />Content-Type: application/xml<br />Content-Length: 216<br /><order xmlns="http://schemas.restbucks.net/order"><br /><drink>latte</drink><br /></order><br />201 Created<br />Location: http://restbucks.net/order/1234<br />ContentType: application/xml<br /><order xmlns="http://schemas.restbucks.net/order"><br />...<br />
  7. 7. Client<br />Service<br />GET/order/1234HTTP/1.1<br />Host: restbucks.net<br />200 OK<br />ContentType: application/xml<br /><order xmlns="http://schemas.restbucks.net/order"><br /><drink>Latte</drink><br />...<br />
  8. 8. click me<br />
  9. 9.
  10. 10. Client<br />Order<br />Resource<br />/order/{orderId}<br />/order/{orderId}<br />Receipt<br />Resource<br />/receipt/{orderId}<br />/receipt/{orderId}<br />Payment<br />Resource<br />/payment/{orderId}<br />/payment/{orderId}<br />
  11. 11. Client<br />Service<br />200 OK<br />ContentType: application/vnd.restbucks+xmlxmlns="http://schemas.restbucks.net/order"><br /><drink>Latte</drink><br /><link href=„payment/1234” rel=„http://relations.restbucks.net/payment”/><br /></order><br />PUT /payment/1234HTTP/1.1<br />Host: restbucks.net<br />Content-Type: application/xml<br />Content-Length: 216<br /><paymentxmlns="http://schemas.restbucks.net/order"><br /><cardNumber>...</cardNumber><br /></order><br />
  12. 12. Client<br />Order<br />Resource<br />/order/{orderId}<br />/order/{orderId}<br />Payment<br />Resource<br />/payment/{orderId}<br />Receipt<br />Resource<br />/receipt/{orderId}<br />
  13. 13. Repositories<br />Domain objects<br />Mappers<br />Representations<br />Activities<br />Resources<br />Infrastructure<br />WCF Web APIs<br />WCF<br />IIS<br />
  14. 14. Q<br />A<br />&<br />

×