WCF 3.5 supports REST POX services using the web service model.
WebHttpBinding supports cookies for session support etc, e.g:
WebHttpBinding webHttpBinding = new WebHttpBinding();
webHttpBinding.AllowCookies = true;
using (ChannelFactory
{ ...
Issues:
- WebInvoke method POST: post data sent only as JSON or XML - no support for simple form encoded parameters.
- General inflexibility when mixing types of data or overloading services make it harder to leverage existing services that support existing AJAX/rich Internet systems.
Blogs, articles and useful resources:
http://bitworking.org/news/125/REST-and-WS
HTTP Programming with WCF and the .NET Framework 3.5 - http://msdn.microsoft.com/en-us/magazine/cc135976.aspx
http://msdn.microsoft.com/en-us/library/system.servicemodel.aspx
http://hyperthink.net/blog/2008/01/18/WCF+Web+Programming+Model+Documentation.aspx
http://msdn.microsoft.com/en-us/library/bb412176.aspx
Rick Strahl's excellent articles:
- REST-Based Ajax Services with WCF in .NET 3.5 http://www.code-magazine.com/Article.aspx?quickid=080014
- WCF REST Configuration for ASP.net AJAX and plain REST Services http://www.west-wind.com/WebLog/posts/310747.aspx
- jQuery AJAX calls to a WCF REST Service http://www.west-wind.com/weblog/posts/324917.aspx
How to consume REST services with WCF - http://blogs.msdn.com/pedram/archive/2008/04/21/how-to-consume-rest-services-with-wcf.aspx
Simple example with DataContract: http://dev.aol.com/node/595
A set of WCF tutorials:
http://dotnet.org.za/hiltong/pages/Windows-Communication-Foundation-_2800_Indigo_2900_-Hello-World-Tutorial.aspx
Interesting problem with XML serialiser quota that you could run into at some point:
http://www.timrayburn.net/2007/10/02/XmlSerializerFormat+Plus+Huge+Schema+Equals+Trouble.aspx
No comments:
Post a Comment