WCF Data Services (or Data Services for short) is another data-centric communication technology built on the WCF stack that exposes data to clients as JSON- or ATOM-serialized RESTful resources using the OData protocol. The OData protocol specifies how a client can query, navigate, and update data exposed by a service. Using this protocol, the client can communicate with the service in a RESTful manner by retrieving data using a standard HTTP GET call (using specially constructed URIs), and sending updates to the server using a standard HTTP POST call.
WCF Data Services是服务以REST的形式发布是非常的简单,相比WCF服务
Data Services shares a number of similarities with RIA Services, and in a way you could consider the two to be sibling technologies, at times both jostling for attention and attempting to outdo each other. Both are built on top of WCF and conform to a pattern to expose data to clients, but each has a somewhat different focus. RIA Services (at least for the time being) specifically targets Silverlight clients, whereas Data Services is client agnostic. While RIA Services generates code in the client project in order for the client to communicate with the services (an aspect that concerns some developers who are against “magic” code generation that they have no control over), Data Services does not need a link to the client project, and no code generation is required. Instead, Data Services provides a client library (discussed shortly) to help the client interact with the service.
It can be difficult to identify whether you should use RIA Services or Data Services in your project, and how the two differ. However, you can break it down to the following:
• RIA Services has a rich model designed for the development of end-to-end Silverlight applications (with the server tightly linked with its client via the code generation process).
• Data Services is designed simply to expose data as RESTful resources in a standalone manner that a range of clients can consume (such as reporting tools that can consume data exposed over HTTP and serialized as either ATOM or JSON). That said, RIA Services can also expose data as RESTful resources that can be consumed by a range of clients (by enabling OData or exposing a JSON endpoint using the functionality provided in the WCF RIA Services Toolkit). Also, together with its ability to share code and validation logic with the client (among the numerous other features it provides), you will find it the best solution when writing an end-to-end Silverlight application. However, if you want your service to support a wide variety of clients without having a tight relationship to your Silverlight project, Data Services is a viable alternative.