MID307
Article source: /2011/05/02/ facebook- marriage-killer?gt1= /2011/05/02/ facebook- marriage-killer?gt1=43001
“The Server”
Traditional Web Service
Howard Dierking photos/belisario/ /
ProductResource ProductResource GET POST GET (id) PUT (id) DELETE (id) GET POST GET PUT DELETE
Demo
photos/alexgoy/ / photos/diwong/ /
HTTP/ OK Cache-Control: private Content-Length: 553 Content-Type: application/json; charset=utf-8 { "description":"Erik Evans magnum opus on DDD", "links":null,"name":"Domain Driven Design", "price":59.99,"productNumber":"200", "quantityOnHand":1 } ProductResource ProductResource GET POST GET (id) PUT (id) DELETE (id) GET Accept: application/json GET Accept: application/json HTTP/ OK Content-Type: application/json HTTP/ OK Content-Type: application/json
Demo
What did he just say? m/photos/mindonfir e/ /
GET HTTP/ Not Modified GET If-None-Match: “1” GET If-None-Match: “1” HTTP/ Not Modified GET HTTP/ OK Cache-Control: max-age=60 Etag:“1”... HTTP/ OK Cache-Control: max-age=60 Etag:“1” ProductResource ProductResource GET POST GET (id) PUT (id) DELETE (id) GET (id)
PUT If-Match: “1” PUT If-Match: “1” HTTP/ OK Etag: “2”... HTTP/ OK Etag: “2”... PUT If-Match: “1” PUT If-Match: “1” HTTP/ Precondition Failed GET HTTP/ OK Etag: “2” HTTP/ OK Etag: “2” PUT If-Match: “2” PUT If-Match: “2” HTTP/ OK Etag: “8”... HTTP/ OK Etag: “8” ProductResource ProductResource GET POST GET (id) PUT (id) DELETE (id) GET (id) PUT (id)
Demo
GET Accept: application/atom+xml GET Accept: application/atom+xml GET HTTP/ OK All Products All my products ProductsFeed T22:30:30-07:00 2 Domain Driven Design T22:30:30-07: ProductResource ProductResource GET POST GET (id) PUT (id) DELETE (id) GET GET (id)
Demo
otos/x- ray_delta_one/ /
Demo
Required Slide Speakers, please list the Breakout Sessions, Interactive Discussions, Labs, Demo Stations and Certification Exam that relate to your session. Also indicate when they can find you staffing in the TLC.
Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub.
Sessions On-Demand & CommunityMicrosoft Certification & Training Resources Resources for IT ProfessionalsResources for Developers Connect. Share. Discuss.
Scan the Tag to evaluate this session now on myTechEd Mobile
.NET Framework 3.0 No support for REST – SOAP only.NET Framework 3.5 Basic infrastructure for non-SOAP HTTP services REST Starter Kit Preview 1 Visual Studio templates for RESTful services Request interceptors REST Starter Kit Preview 2 HTTP client library.NET Framework 4.0 ASPNET routes integration Automatic content negotiation
Level 3: HypermediaLevel 2: HTTPLevel 1: URIs Level 0: Web Services Richardson’s HTTP maturity model
CartService.svc GetCart() ClearCart() UpdateCartItem(itemId, Qty) RemoveCartItem(itemId) AddCartItem(itemId, Qty) ApplyShippingInfo (shippingOption, shippingAddress) ApplyShippingInfo (shippingOption, shippingAddress) ApplyBillingInfo(billingAddress, paymentType, paymentInfo) … … POST HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "GetCart" Content-Length: 154 <s:Envelope xmlns:s=" <GetCart xmlns=" HTTP/ OK Content-Length: 984 Content-Type: text/xml; charset=utf-8 Date: Tue, 26 Apr :22:53 GMT T18:22: :00 Product T18:22: :00... POST SOAPAction: "GetCart" 200 OK Content-Type: text/xml T18:22: :00
CartService.svc GetCart() ClearCart() UpdateCartItem(itemId, Qty) RemoveCartItem(itemId) AddCartItem(itemId, Qty) ApplyShippingInfo (shippingOption, shippingAddress) ApplyShippingInfo (shippingOption, shippingAddress) ApplyBillingInfo(billingAddress, paymentType, paymentInfo) … … POST HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "GetCart" Content-Length: 154 <s:Envelope xmlns:s=" <GetCart xmlns=" HTTP/ Internal Server Error Content-Length: 734 Content-Type: text/xml; charset=utf-8 Date: Wed, 27 Apr :15:00 GMT a:InternalServiceFault Internal Server Error a:InternalServiceFault... a:InternalServiceFault...
Demo