开发者

Implementing REST in WCF

开发者 https://www.devze.com 2023-02-28 23:40 出处:网络
I have a exist开发者_如何学JAVAing WCF in .NET which is consumed through wsdl and proxy classes. Soon, there will be multiple consumers and the load on the WCF will be pretty high. I was asked to deve

I have a exist开发者_如何学JAVAing WCF in .NET which is consumed through wsdl and proxy classes. Soon, there will be multiple consumers and the load on the WCF will be pretty high. I was asked to develop a new WCF with REST which can be beneficial interms of performance. I don't have much knowledge on REST, hence can you please let me know whether implementing a RESTFUL WCF will improve the performance drastically? Please provide me any links to implement the same.

Thanks in advance, Vinoth Khanna.S


You can also use WCF Data Services to easily offer a REST interface to your data.

The easiest way is to build an Entity Framework model of your data and then to expose that model as a WCF Data Service. This then exposes all data using the OData protocol, which is REST + AtomPub.

And Kiran is of course right, REST by itself does not increase performance. I assume that you want your UI to access the REST service directly rather than go through a web service which contains hand-written methods to read and write data. In that case, there may be some performance gain, but I wouldn't count on it much.

See also:

http://msdn.microsoft.com/en-us/library/cc668794.aspx

and

http://en.wikipedia.org/wiki/WCF_Data_Services

If you want to return results as JSON, the easiest way to get that to work is by adding the WCF Data Services Toolkit:

http://wcfdstoolkit.codeplex.com/


As far as I know REST is not for performance enhancement, it makes your webmethods URL accessible and make those URL's more predictable and logical. I would start with this video http://channel9.msdn.com/Events/PDC/PDC08/TL35 then with WCF REST Starter Kit http://www.asp.net/downloads/starter-kits/wcf-rest

0

精彩评论

暂无评论...
验证码 换一张
取 消