0
kicks
Consume an OData WCF Data Service as JSON with JQuery
OData(Open Data Protocol) is an HTTP based protocol for querying and updating data using full REST syntax. The full specifications of OData can be found on http://odata.org
WCF Data Services (formerly ADO.NET Data Services, formerly Project Astoria) is the .NET based implementation of OData enabled services. WCF Data Services can use an Entity Framework Context or any data model exposing at least one property that returns an entity set that is an IQueryable(Of T). The model must also implement IUpdatable.
A sample http request to an OData service will look like:
http://services.odata.org/OData/OData.svc/Categories(1)/Products?$skip=2
This example will get the products associated with the category identified by key value 1, starting with the third product.
WCF Data Services is capable of returning data in multiple formats. The default format will be set based on the requesting client’s accept request header with an option to override the format using the $format query option. For example, this will return the results from the previous example in JSON format:
http://services.odata.org/OData/OData.svc/Categories(1)/Products?$skip=2&$format=json