1 / 9

How to build a Simple REST based service in WCF

How to build a Simple REST based service in WCF. Adnan Masood www.AdnanMasood.com. About Me aka. Shameless Self Promotion. Sr. Software Engineer / Tech Lead for Green Dot Corp. (Financial Institution) Design and Develop Connected Systems

chilton
Télécharger la présentation

How to build a Simple REST based service in WCF

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to build a Simple REST based service in WCF Adnan Masood www.AdnanMasood.com

  2. About Meaka. Shameless Self Promotion • Sr. Software Engineer / Tech Lead for Green Dot Corp. (Financial Institution) • Design and Develop Connected Systems • Involved with SoCal Dev community, co-founded San Gabriel Valley .NET Developers Group. Published author and speaker. • MS. Computer Science, MCPD (Enterprise Developer), MCT, MCSD.NET • Doctoral Student - Areas of Interest: Machine learning, Bayesian Inference, Data Mining, Collaborative Filtering, Recommender Systems. • Contact at adnanmasood@acm.org • Read my Blog at www.AdnanMasood.com • Doing a session in IASA 2008 in San Francisco on Aspect Oriented Programming; for details visit http://www.iasaconnections.com

  3. What is REST? • REST is a term coined by Roy Fielding in his Ph.D dissertation [1] to describe an architecture style of networked systems. [1] http://www.ebuilt.com/fielding/pubs/dissertation/top.htm

  4. WCF Support to REST • WebHttpBinding: Sends information directly over HTTP or HTTPS—no SOAP envelope is created. This binding is new with the .NET Framework 3.5 version of WCF, and it’s the right choice for RESTful communication and other situations where SOAP isn’t required. The binding offers three options for representing content: text-based XML encoding, JavaScript Object Notation (JSON) encoding, and opaque binary encoding.

  5. Examples • http://example.com/users/ http://example.com/users/{user} (one for each user) http://example.com/findUserForm http://example.com/locations/ http://example.com/locations/{location} (one for each location) http://example.com/findLocationForm

  6. REST vs. SOAP • Enhanced Caching • Invocation vs. Resource • Bloat vs. Simplicity • Proxy Servers • Web evolution (semantic Web) • Generic Uribased interface via UriTemplates (versus custom SOAP interface) • Interoperability

  7. References • HTTP Programming with WCF and the .NET Framework 3.5 - Justin Smithhttp://msdn.microsoft.com/msdnmag/issues/08/01/WCFinOrcas/default.aspx • What's New for WCF in Visual Studio 2008 – Juval Lowy http://msdn.microsoft.com/msdnmag/issues/08/02/Foundations/default.aspx • RESTful Web Services By Leonard Richardson, Sam Rubyhttp://www.amazon.com/RESTful-Web-Services-Leonard-Richardson/dp/0596529260 • Mix 2007 Talk by Don Box and Steve Maine “DEV03 - Navigating the Programmable Web” http://sessions.visitmix.com/default.asp?event=1011&session=2012&pid=DEV03&disc=&id=1512&year=2007&search=DEV03

  8. References • Paul Prescod has written several excellent articles on REST: • Second Generation Web Services • http://www.xml.com/pub/a/2002/02/06/rest.html • REST and the Real World • http://www.xml.com/pub/a/2002/02/20/rest.html • SOAP, REST and Interoperability • http://www.prescod.net/rest/standardization.html • Evaluating XML for Protocol Control Data • http://www.prescod.net/xml/envelopes/ • Wikipedia Entry on REST • http://en.wikipedia.org/wiki/Representational_State_Transfer • Publishing RSS and ATOM Feeds using WCF 3.5 Syndication Libraries • http://www.codeproject.com/KB/WCF/WCF35RSSATOM.aspx • Exploring WCF 3.5 Tools - WcfSvcHost and WcfTestClient • http://www.codeproject.com/KB/WCF/WCF35Utils.aspx • Web Service Studio • http://www.codeplex.com/WebserviceStudio • JSON • http://en.wikipedia.org/wiki/JSON

  9. Concluding Remarks • REST is a “new” paradigm for .NET Developers; a new way to think about programming web services but it’s not really new since we have been using it for a long time over the web. • Any Questions / Comments … feel free to contact adnanmasood@gmail.com • Visit www.AdnanMasood.com

More Related