Download presentation
Presentation is loading. Please wait.
Published byDelilah Lewis Modified over 9 years ago
1
Pete Brown Developer Community Program Manager, Microsoft http://10rem.net, Twitter: @pete_brown, pete.brown@microsoft.com REST with Silverlight 5, WCF ASP.NET Web API, and a little MVC 4 (AKA: Let’s see how many product names will fit in a session title) (or, the live version of part of chapters 21 and 22 of Silverlight 5 in Action)
2
Where to find help Our Community Sites silverlight.net silverlight.net windowsclient.net windowsclient.net asp.net asp.net dev.windows.com dev.windows.com MSDN: msdn.microsoft.commsdn.microsoft.com My Blog: 10rem.net10rem.net Will include any updated source/examples
3
REST in a Nutshell REpresentational State Transfer Relies on verbs Primarily GET, PUT, POST, DELETE The architecture of the web
4
The 6 REST Constraints Client-ServerA clear separation of concerns StatelessThe server should not store any client context information between requests. Each request is autonomous CacheableServer indicates which content is cacheable, just as we do with pages and images today LayeredClient is not concerned with whether or not it is connected to a specific server, a proxy, or something else Code on-demandServer can send logic to the client to execute. For example, Java applets or Silverlight apps Uniform interfaceURIs. Self-descriptive messages (media types, cacheability, etc.)
5
What RESTful Services get you Instantly accessible to any client which can make web requests No need for client proxies, stubs, envelopes and the other stuff we have to deal with Especially important with the proliferation of connected microcontrollers Cacheable using normal web-aware mechanisms Scalable for the same reason Flexible if you go with a full hypermedia approach
6
WCF ASP.NET Web API An API that supports you in building RESTful APIs Does not impose REST constraints Does not get in your way Architected to rely on and exploit HTTP fully, not just as a generic transport Written by the WCF Team at Microsoft. Now available as part of ASP.NET MVC 4
7
This Example Silverlight Client ASP.NET MVC ASP.NET Web API Data Serves Uses Primarily focus on the Silverlight client and Web API Server.
8
Project Internal corporate application Shared across many divisions Control some, but not all, clients Goals and constraints Use RESTful approaches to make API available to as many clients as possible No fat Soap envelope No proprietary WCF formats Make it really easy for Silverlight (or other owned clients) to use the resources Don’t want to recreate entities For V1, don’t worry about security (Boy, was that convenient!)
9
DEMO Stuff with semicolons and curly braces … and the occasional angle bracket
10
Summary Web API for RESTful “services” Web API Now part of ASP.NET MVC Silverlight + MVC play together nicely Create a Razor helper for hosting Silverlight Linked files to share model definitions Conditional compilation or partial classes for platform-specific features My book has awesome demos
11
Where to find help Our Community Sites silverlight.net silverlight.net windowsclient.net windowsclient.net asp.net asp.net dev.windows.com dev.windows.com MSDN: msdn.microsoft.commsdn.microsoft.com My Blog: 10rem.net10rem.net Will include any updated source/examples Twitter: @pete_brown@pete_brown Mail pete.brown@microsoft.com pete.brown@microsoft.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.