by Raju Maharjan
7. August 2011 17:11
WCF Data Services (originally known as ADO.NET Data Services) is a framework for exposing data layers in a REST-ful manner, using JSON or Atom as the output format. WCF Data Services is a component of the .NET Framework that enables you to create services that use the Open Data Protocol (OData) to expose and consume data over the Web or intranet by using the semantics of REST (Representational State Transfer). OData exposes data as resources that are addressable by URIs. Data is accessed and changed by using standard HTTP verbs of GET, PUT, POST, and DELETE. OData uses the entity-relationship conventions of the Entity Data Model to expose resources as sets of entities that are related by associations.
While the technology is relatively new, it addresses a number of common use cases for developers, including:
- Allow AJAX applications access to the database via HTTP without writing a Web service as a proxy.
- Provide access to data to third-parties in a standardized, vendor neutral fashion.
- Create a REST-ful data access system without the baggage of other Web service systems.
The technology automatically creates a REST-ful Web service that emits JSON or Atom based on a provided configuration. This means that the developer is now off the hook for writing an entire Web service, serializing the data to JSON or Atom, and so on, which can save significant amounts of time.
- uses the OData protocol for addressing and updating resources. In this way, you can access these services from any client that supports OData. OData enables you to request and write data to resources by using well-known transfer formats: Atom, a set of standards for exchanging and updating data as XML, and JavaScript Object Notation (JSON), a text-based data exchange format used extensively in AJAX application.
- can expose data that originates from various sources as OData feeds. Visual Studio tools make it easier for you to create an OData-based service by using an ADO.NET Entity Framework data model. You can also create OData feeds based on common language runtime (CLR) classes and even late-bound or un-typed data.
- includes a set of client libraries, one for general .NET Framework client applications and another specifically for Silverlight-based applications. These client libraries provide an object-based programming model when you access an OData feed from environments such as the .NET Framework and Silverlight.