Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF REST vs. ADO.NET Data Services

Could someone compare and contrast on WCF Rest services vs. ADO.NET Data Services? What is the difference and when to use which?

Thanks,

Ray.

Edit: thanks to the first answer, just to give a bit background on what I'm looking to do: I have a web app I plan to put in the cloud (someday), the DAL is built with ADO.NET Entity Framework. And, I need to figure which web service data access technology would best fit my case.

like image 718
Ray Avatar asked Dec 02 '08 16:12

Ray


People also ask

What is the difference between WCF REST service and Web API?

WCF does not provide any support for MVC features like controllers, routing, filter, auction results, etc. ASP.NET Web API supports MVC features like routing, controllers, results, filter, action, etc. It is not open source software. It is shipped with.Net framework.It is also available as an independent download.

What is WCF REST service?

WCF stands for Windows Communication Foundation, it works based on Simple Object Access Protocol. REST stands for Representational State Transfer. REST supports cross-platform and exchange data in JSON and XML format and use the HTTP protocols (GET, POST, PUT, PATCH and DELETE)

What is difference between SOAP and REST WCF service?

Actually only the difference is how clients access our service. Normally, a WCF service will use SOAP, but if you build a REST service, clients will be accessing your service with a different architectural style (calls, serialization like JSON, etc.).

What is the benefit of Web API over WCF?

WEB API is a better choice for simpler, light weight services. WEB API can use any text format including XML and is faster than WCF. WEB API can be used to create full-blown REST Services. WEB API doesn't require any data contracts and doesn't require configurations to the level of WCF.


2 Answers

Not sure I can give a complete answer here but I spent a lot of time at PDC trying to figure this out myself so here’s a go...

The short answer here is that ADO.Net Data Services are meant to provide an interface to the ADO.Net framework (DataContext, Datasets, DataTables etc…) that is seamlessly integrated with the web, using URIs and well-known data to point to your Data. ADO.Net Data Services are also meant for programming ADO.Net in the cloud. Microsoft's Cloud services, "Azure", is a new cloud programming platform that will be release in the near future. For more info on Cloud Services go here.

One cool thing I found out about ADO.Net Data Services and the cloud is that the underlying DataContext that acts as the provider to your data source can be easily configured to point your resource in the cloud, or, an on premise database. This allows you to switch your DataContext without changing any code!!! (I was impressed by that if you couldn't tell)

WCF Rest Services are just normal WCF Services that have added functionality so that they can be consumed in a RESTful manner (URI vs URL, Usage of HTTTP Verbs, Usage of Different Data Transfer Formats like JSON, YAML, etc...). So for example, if you had a stock ticker web service that you built in WCF, instead of requiring the caller to use a heavy WSDL implementation and ASMX, you could just use the WCF Rest functionality to publish that service as a JSON service instead and have it consumed via AJAX without having to point to an ASMX resource. For more info on WCF using rest check out the PDC Presentation

like image 61
matt_dev Avatar answered Sep 27 '22 02:09

matt_dev


Thank you so much for the insight! For my app, I do plan to put it in the cloud and I also used ADO.NET Entity Framework to build my DAL, so it sounds like ADO.NET Data Services is the one for me to choose.

One cool thing I found out about ADO.Net Data Services and the cloud is that the underlying DataContext that acts as the provider to your data source can be easily configured to point your resource in the cloud, OR, an on premise database. This allows you to switch your DataContext without changing any code!!! (I was impressed by that if you couldn't tell)

Could you maybe say more on this point regarding how ADO.NET Data Service + EF would work in the cloud?

like image 26
Ray Avatar answered Sep 27 '22 02:09

Ray