WCF Data Services client for Windows Phone 7 available
It’s been almost a year since Microsoft announced the Open Data Protocol (OData) at PDC09. OData is a web protocol for querying and updating data using open standards such as HTTP and AtomPub. We released OData under the Open Specification Promise (OSP) to allow anyone to freely interoperate with OData implementations.
As a result, there’s been a lot of exciting adoption of OData in the community. Several OData feeds have been released, such as the Netflix feed, the Open Government Data Initiative and the many great feeds that are part of the Windows Azure DataMarket (formerly known as codename Dallas). A number of server and client tools have got also released such as the IBM WebSphere support for OData, SharePoint 2010 and PowerPivot for Excel 2010.
At PDC 2010, Microsoft announced several exciting additions to the OData ecosystem. First, Microsoft is releasing a new OData Client for Windows Phone 7 to make it easier to consume feeds from a Windows Phone7 application. Starting today, you can access several new feeds from sources like EBay and Twitpic. Finally, Microsoft is making available a set of libraries to make creating custom OData feeds easier on the Windows Azure Platform.
At PDC this year, it was announced that a production-ready version of the WCF Data Services client for Windows Phone 7 is available for download from http://odata.codeplex.com. This means that it is now simple to create an app that connects your Windows Phone 7 to all the existing OData services as well as the new ones we’re announcing at this PDC.
The release includes a version of System.Data.Services.Client.dll that is supported on the phone (both the assembly and the source code) and a code generator tool to generate phone-friendly client side proxies.
The library follows most of the same patterns you are already used to when programming with OData services on the desktop version of Silverlight. The key changes from Silverlight desktop to be aware of are:
- LINQ support in the client library has been removed as the core support is not yet available on the phone platform. That said, Microsoft is actively working to enable this in a future release. Given this, the way to formulate queries is via URIs.
- A LoadAsync(Uri) method was added to the DataServiceCollection class to make it simple to query services via URI.
- So you can easily support the phone application model that was added a new standalone type ‘DataServiceState’ which makes it simple to tombstone DataServiceContext and DataServiceCollection instances