Chapter 4. Using Open Data

In this chapter, we will cover:

  • Consuming OData services
  • Searching OData services
  • CRUD operations with OData

Introduction

Open Data is also known as OData. OData is a web protocol for querying and manipulating data. It uses the REST (Representational State Transfer) based URI syntax for querying and filtering data.

OData works over HTTP and follows a simple syntax, which can be used in accessing any web resource. Different operations such as create, read, update, and delete can be performed using a URI with query string syntax.

OData supports AtomPub (Atom Publishing Protocol) and JSON (JavaScript Object Notation) to access the data from different sources such as relational databases, file systems, content management systems, and websites. AtomPub is based on the W3 standard Atom (RFC 4287).

OData provides features built on top of AtomPub, which are for creating, updating, and deleting data. In addition to AtomPub features, OData also provides rich features for querying and manipulating data.

Windows Phone 7.1 SDK supports the following OData features:

  • OData Client Library is included in the SDK, hence no separate download is required.
  • You can now generate client proxy classes by adding the reference to the OData service feeds.
  • Two main classes supported are DataServiceContext class and DataServiceCollection<T> class.
  • LINQ queries to OData resources are supported. It continues to support URI-based queries as well.
  • Client authentication is supported. Now you can use a username and password to authenticate the OData Service.
  • It supports the ability to access binary data, for instance, to download a large media resource separate from the entity it belongs to.
  • We can still use the DataSvcUtil to generate proxy classes with the command-line. Various arguments are available such as /uri, /out, /in, /language, /version, and /DataServiceCollection.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset