RESTful .NET is the first book that teaches Windows developers to build RESTful web services using the latest Microsoft tools. Written by Windows Communication Foundation (WFC) expert Jon Flanders, this hands-on tutorial demonstrates how you can use WCF and other components of the .NET 3.5 Framework to build, deploy and use REST-based web services in a variety of application scenarios.
RESTful architecture offers a simpler approach to building web services than SOAP, SOA, and the cumbersome WS- stack. And WCF has proven to be a flexible technology for building distributed systems not necessarily tied to WS- standards. RESTful .NET provides you with a complete guide to the WCF REST programming model for building web services consumed either by machines or humans. You'll learn how to:
Program Read-Only (GET) services
Program READ/WRITE services
Host REST services
Program REST feeds
Program AJAX REST clients
Secure REST endpoints
Use workflow to deliver REST services
Consume RESTful XML services using WCF
Work with HTTP
Work with ADO.NET Data Services (Astoria)
RESTful .NET introduces you to the ideas of REST and RESTful architecture, and includes a detailed discussion of how the Web/REST model plugs into the WCF architecture. If you develop with .NET, it's time to jump on the RESTful bandwagon. This book explains how.
"While REST is simple, WCF is not. To really understand and exploit this part of WCF requires a knowledgeable and experienced guide. I don't know anybody who's better suited for this role than Jon Flanders. ...Jon is first-rate at explaining complicated things. This book is the best introduction I've seen to creating and using these services with WCF."--David Chappell, Chappell & Associates
Chapter 1 REST Basics
Architecture of the World Wide Web
SOAP
REST
Implementing a Simple RESTful Service Example
Processes
Summary
Chapter 2 WCF RESTful Programming Model
Isn’t WCF All About SOAP?
Channels and Dispatching
HTTP Programming with WCF 3.0
Web Programming in WCF 3.5
UriTemplate
Summary
Chapter 3 Programming Read-Only Services
Using WebGetAttribute and UriTemplate
Data Formats
Summary
Chapter 4 Programming Read/Write Services
POST, PUT, and DELETE
Using WebInvokeAttribute
Summary
Chapter 5 Hosting WCF RESTful Services
WCF REST Hosting Isn’t a Special Case
Self-Hosting
Hosting in IIS
Custom ServiceHostFactory
Hosting Wrap-Up
Summary
Chapter 6 Programming Feeds
Building a Feed with WCF
Exposing a Feed on a Live URI
Feed Validation
Adding Links to a Feed
Summary
Chapter 7 Programming Ajax and Silverlight Clients
WCF Web Services and Ajax
JSON
ASP.NET Ajax
Silverlight 1.0
Silverlight 2.0
Returning JSON and XML Conditionally with a Single Method
Summary
Chapter 8 Securing REST Endpoints
Authenticating: Self-Hosted Endpoints
Authenticating: Managed Hosting Endpoints
Authorizing Endpoints
Summary
Chapter 9 Using Workflow to Deliver REST Services
Consuming REST Services from WF
The SendActivity Instance
The ReceiveActivity Instance
Stateless Workflow Services
Stateful Workflow Services
Summary
Chapter 10 Consuming RESTful XML Services Using WCF
Although Jon Flanders spent the first few years of his professional life as an attorney, he quickly found chasing bits more interesting than chasing ambulances. After working with ASP and COM, he made the move to .NET. Jon is most at home spelunking, trying to figure out exactly how .NET (specifically ASP.NET and Visual Studio .NET) works. Deducing the details and disseminating that information to other developers is his passion.
The animal on the cover of RESTful .NET is an electric catfish (Siluriformes malapteruridae). Located mainly in tropical Africa and the Nile River, the generally nocturnal catfish can produce an electric shock of up to 350 volts, which it uses to stun or kill its enemies (the shock is not fatal to humans).
Often seen in large display tanks at aquariums, the electric catfish has thick lips and a cylinder-shaped, pinkish-brown body with several dark spots. The fish's electric organ-used to generate shocks-extends the length of its body, and, when lit, helps the fish see through its murky surroundings.
In the normal course of its waking hours, the fish acts aggressively against other fish and even against others of its own kind. Each successive shock its electric organ produces, however, weakens the fish, which then must rest in order to "recharge" its electricity, thus rendering it temporarily vulnerable to predators. The fish is also vulnerable for another reason: its body has no scales or bony plates, making the fish relatively defenseless against hot aquarium tanks or sharp rocks.
The cover image is from Dover's Animals. The cover font is Adobe ITC Garamond. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSansMonoCondensed.
RESTful.net does a great job explaining why REST is a breeze with WCF 3.5. It starts out by first explaining why REST was difficult with WCF 3.0, a common complaint by many .NET REST fans, but then it goes on to show what specific changes in WCF 3.5 now make it a piece of cake.
The book explains exactly what REST is and continually provides insight into how it is different from SOAP and why those differences are both important and advantageous. Every conceivable use case of how to use WCF 3.5 with REST is then covered in enough detail to make it easy to quickly start a new REST based services project. It covers services, clients, security, AJAX, Silverlight, WPF, and even Windows Workflow.
Overall I would highly recommend this book for anyone interested in taking the power and flexibility of WCF and combining it with the open and easy to use REST based service architecture.