ADO.NET Data Services
Encyclopedia
WCF
Data Services (formerly ADO.NET Data Services, codename "Astoria") is a platform for what Microsoft
calls Data Services. It is actually a combination of the runtime and a web service
through which the services are exposed. In addition, it also includes the Data Services Toolkit which lets Astoria Data Services be created from within ASP.NET
itself. The Astoria project was announced at MIX
2007, and the first developer preview was made available on April 30, 2007. The first CTP was made available as a part of the ASP.NET
3.5 Extensions Preview. The final version was released as part of Service Pack
1 of the .NET Framework 3.5 on August 11, 2008. The name change from ADO.NET Data Services to WCF data Services was announced at the 2009 PDC
.
-like URI
. The Astoria service, when accessed via the HTTP GET method with such a URI, will return the data. The web service can be configured to return the data in either plain XML
, JSON
or RDF+XML
. In the initial release, formats like RSS
and ATOM
are not supported, though they may be in the future. In addition, using other HTTP methods like PUT, POST or DELETE, the data can be updated as well. POST can be used to create new entities, PUT for updating an entity, and DELETE for deleting an entity.
The URIs representing the data will contain the physical location of the service, as well as the service name. In addition, it will also need to specify an EDM Entity-Set or a specific entity instance, as in respectively
http://dataserver/service.svc/MusicCollection
or
http://dataserver/service.svc/MusicCollection[SomeArtist]
The former will list all entities in the Collection set whereas the latter will list only for the entity which is indexed by SomeArtist.
In addition, the URIs can also specify a traversal of a relationship in the Entity Data Model. For example,
http://dataserver/service.svc/MusicCollection[SomeSong]/Genre
traverses the relationship Genre (in SQL parlance, joins with the Genre table) and retrieves all instances of Genre that are associated with the entity SomeSong. Simple predicates can also be specified in the URI, like
http://dataserver/service.svc/MusicCollection[SomeArtist]/ReleaseDate[Year eq 2006]
will fetch the items that are indexed by SomeArtist and had their release in 2006. Filtering and partition information can also be encoded in the URL as
http://dataserver/service.svc/MusicCollection?$orderby=ReleaseDate&$skip=100&$top=50
It is important to note that although the presence of skip and top keywords indicate paging support, in Data Services version 1 there is no method of determining the number of records available and thus impossible to determine how many pages there may be. The OData
2.0 spec adds support for the $count path segment (to return just a count of entities) and $inlineCount (to retrieve a page worth of entities and a total count without a separate round-trip).
Windows Communication Foundation
The Windows Communication Foundation , previously known as "Indigo", is an application programming interface in the .NET Framework for building connected, service-oriented applications.-The architectures:...
Data Services (formerly ADO.NET Data Services, codename "Astoria") is a platform for what Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...
calls Data Services. It is actually a combination of the runtime and a web service
Web service
A Web service is a method of communication between two electronic devices over the web.The W3C defines a "Web service" as "a software system designed to support interoperable machine-to-machine interaction over a network". It has an interface described in a machine-processable format...
through which the services are exposed. In addition, it also includes the Data Services Toolkit which lets Astoria Data Services be created from within ASP.NET
ASP.NET
ASP.NET is a Web application framework developed and marketed by Microsoft to allow programmers to build dynamic Web sites, Web applications and Web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages ...
itself. The Astoria project was announced at MIX
MIX (Microsoft)
MIX is a Microsoft conference held annually for web developers and designers at which Microsoft showcases upcoming web technologies. The conference is held each spring at the Venetian Hotel in Las Vegas...
2007, and the first developer preview was made available on April 30, 2007. The first CTP was made available as a part of the ASP.NET
ASP.NET
ASP.NET is a Web application framework developed and marketed by Microsoft to allow programmers to build dynamic Web sites, Web applications and Web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages ...
3.5 Extensions Preview. The final version was released as part of Service Pack
Service pack
A service pack is a collection of updates, fixes or enhancements to a software program delivered in the form of a single installable package. Many companies, such as Microsoft or Autodesk, typically release a service pack when the number of individual patches to a given program reaches a certain ...
1 of the .NET Framework 3.5 on August 11, 2008. The name change from ADO.NET Data Services to WCF data Services was announced at the 2009 PDC
Professional Developers Conference
Microsoft's Professional Developers Conference is a conference for software developers, normally Windows developers.It covers new and upcoming technology from Microsoft, and so only occurs in the years when there is something new to talk about...
.
Overview
ADO.NET Data Services exposes data, represented as Entity Data Model (EDM) objects, via web services accessed over HTTP. The data can be addressed using a RESTRepresentational State Transfer
Representational state transfer is a style of software architecture for distributed hypermedia systems such as the World Wide Web. The term representational state transfer was introduced and defined in 2000 by Roy Fielding in his doctoral dissertation...
-like URI
Úri
Úriis a village and commune in the comitatus of Pest in Hungary....
. The Astoria service, when accessed via the HTTP GET method with such a URI, will return the data. The web service can be configured to return the data in either plain XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....
, JSON
JSON
JSON , or JavaScript Object Notation, is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript scripting language for representing simple data structures and associative arrays, called objects...
or RDF+XML
Resource Description Framework
The Resource Description Framework is a family of World Wide Web Consortium specifications originally designed as a metadata data model...
. In the initial release, formats like RSS
RSS
-Mathematics:* Root-sum-square, the square root of the sum of the squares of the elements of a data set* Residual sum of squares in statistics-Technology:* RSS , "Really Simple Syndication" or "Rich Site Summary", a family of web feed formats...
and ATOM
Atom
The atom is a basic unit of matter that consists of a dense central nucleus surrounded by a cloud of negatively charged electrons. The atomic nucleus contains a mix of positively charged protons and electrically neutral neutrons...
are not supported, though they may be in the future. In addition, using other HTTP methods like PUT, POST or DELETE, the data can be updated as well. POST can be used to create new entities, PUT for updating an entity, and DELETE for deleting an entity.
The URIs representing the data will contain the physical location of the service, as well as the service name. In addition, it will also need to specify an EDM Entity-Set or a specific entity instance, as in respectively
or
The former will list all entities in the Collection set whereas the latter will list only for the entity which is indexed by SomeArtist.
In addition, the URIs can also specify a traversal of a relationship in the Entity Data Model. For example,
traverses the relationship Genre (in SQL parlance, joins with the Genre table) and retrieves all instances of Genre that are associated with the entity SomeSong. Simple predicates can also be specified in the URI, like
will fetch the items that are indexed by SomeArtist and had their release in 2006. Filtering and partition information can also be encoded in the URL as
It is important to note that although the presence of skip and top keywords indicate paging support, in Data Services version 1 there is no method of determining the number of records available and thus impossible to determine how many pages there may be. The OData
Open Data Protocol
The Open Data Protocol is an open web protocol for querying and updating data. The protocol allows for a consumer to query a datasource over the HTTP protocol and get the result back in formats like Atom, JSON or plain XML, including pagination, ordering or filtering of the data.Many of the...
2.0 spec adds support for the $count path segment (to return just a count of entities) and $inlineCount (to retrieve a page worth of entities and a total count without a separate round-trip).