Holy cow! How often do you get a chance to win a piece of $24,000 worth of swag at a user group meeting? November marks the end of the CINNUG membership drive. We’re giving away 2 MSDN subscriptions valued at approximately $11K apiece, and XBOX, year-long access to Safari books, and more. About 50 people in the room gearing up for Dan Rigsby’s talk on REST. And if we’re lucky, Levy will get his Azure app working in time for the end of the talk. Who else was there? The venerable Rob Eberhardt and Joe Wirtley, Phil Japiske from Pinnacle, Rich Rayburn, Mike Wood of SDS, Western Southern Life’s Matt Brewer, Telligent’s Leon Gersing, Peggy Krpata from Cincinnati Financial, Quality Gold’s Clarence Klopfstein, Maggie Longshore of Sogeti, Ellen Steiner, and more. And the pizza’s free! What can I say? CINNUG is really out of this world.
Services in the late 90s were all SOAP representing everything we needed. Then interop reared its ugly head and WS-* became complex. Roy Fielding proposed REST in his 2000 doctorial thesis. Can we build and architecture style on the web? REST is a style, not a standard, so there is no right or wrong way to do it.
4 Tenents of REST
- Embrace the URI – URI segments map to domain semantics
- HTTP verbs are your methods – GET is special because you do it most of the time
- Content-Type is the object model
- The status code is the result
HTTP can map to CRUD
- GET is Read, and cacheable
- POST is Create
- PUT is Update
- DELETE is Delete
High REST is the strict interpretation of REST. Every time you interact wiht a resource you use an HTTP verb. Low REST is not so strict. You might put a method inside the query string. RESTful means that REST is being used.
Why is REST important? MS embraces it. WCF, Azure, ADO.NET, AJAX all depend on REST. REST/POX (Plain Ol’ XML) is much more widely used. Amazon services 85% REST. Google maps all REST based.
What are advantages of REST? Long reach and interoperability, very light weight, scalable applications and cacheable calls, less work on the client, and a URI allows categorization of everything.
But there is no metadata. No WSDL. You need to parse the XML and figure out what it is. Also, no message level security as security is only at the transport level. WS* features don’t exist, but with most simple services it is fine to not have these things. A common standard does not exist. REST is not appropriate with large amounts of data.
So, with SOAP you kindly request formal data with all the platitudes. With REST you tersely order the recipient of the request around. Still, they work together, and all services could be implemented in both SOAP and RESTfully.
WCF added REST support in .NET 3.5 with new namespace System.ServiceModel.Web. The extensible WCF model holds as no existing code needed to change with the addition of REST support.
How WCF handles the Tenant 1 – System.UriTemplate where {} Holes represent the segment that maps to the domain semantic.
Tenant 2 – System.ServiceModel.Web.WebGet assumes GET, and .WebInvoke allows for any HTTP method.
Tenant 3 – didn’t catch this one. sorry.
Tenant 4 – WebOperationContext complements the OperationContext of WCF to set and get the status code.
Dan did 9 demos and showed a lot of code to help drill the concepts for us. DanRigsby.com has all the demo code under his speaking engagements section.
What can we use REST for? Syndication. RSS vs. Atom. Both XML Syndication formats that define distribution. Atom has more features, but RSS more accepted. Atom is growing now, and WCF understands both. So there is a need to create syndication objects independent of format. You can do this with the System.ServiceModel.Syndication.
MS released the WCF REST Starter Kit in October that includes Help, Representations, Caching, HTTP Verbs, Security, Error Handling, Hosting Settings, and Templates features.
After a bunch of demos we broke for pizza. On return, Mike Levy did a great talk on Azure. I mean REALLY Great! Did the code work? Does it really matter? It’s way cool. Eventually it did. Resources include the Azure SDK, Training Kit, and tools for Visual Studio.
Now for the swag.
- Andy
