Wouldn’t that be cool to have more ways to unlock your data and free it from applications silos?
Today we are announcing a new version of the OData SDK for PHP (previously called Toolkit for PHP with ADO.NET/WCF Data Services). This version includes new features like the capability of handling large result sets of data using an automated paging mechanism and a new sample built on top of an OData feed exposing the Netflix catalog, which we are covering in detail in this blog post. Link for more detail on the OData SDK for PHP.
We also announced today the new OData SDK for Objective C which facilitates the development of applications for iPhone and Mac OS X connecting with OData services. This early version is a Community Technology Preview (CTP) and it supports read operations only and it has been tested on a limited set of scenarios. The download includes a sample iPhone application to browse the new NetFlix OData service hosted in Azure.
Finally, Noelios has just updated the Restlet Extension for OData – a set of tools and libraries for Java. Read Jerome Louvel’s post Restlet supports OData, the Open Data Protocol for more details. Noelios has also released a new detailed tutorial for developers who want to access OData services in Java.
The list of OData SDKs is available at http://www.odata.org/developers/odata-sdk.
About Open Data protocol – oData
In essence, the purpose of the OData is to feed the web with more consumable data and give the developers and entrepreneur more power to create new scenarios.
OData enables data integration across a broad range of clients, servers, services, and tools. OData builds on a few conventions, popularized by AtomPub, to using REST-based data services. These services allow resources, identified using Uniform Resource Identifiers (URIs) and defined in an abstract data model, to be read and edited by web clients using simple HTTP messages. For more details, consult the protocol documentation on the OData site where you will also find a list of services and products that are already using OData.
Read “Open Data for the Open Web” by
Doug Purdy for more perspective on OData.
The Netflix demo scenario
The demo starts with a search form with multiple pull-down menus you can use to narrow the search for titles in the catalog. To keep the demo simple, we limited on purpose the set of the fields that could be used to build an advanced search on the OData service. We actually use only the “Genre” and “Language” options which are prepopulated with values coming from the Netflix OData feed and the “Name” (movie title):
Once the user has selected his criteria and hit search, the PHP application calls the Netflix OData feed through a simple method call, highlighted below:
And then a list of corresponding titles is returned by the Netflix oData feed. The result set is filtered and sorted by the Netflix service; you just have to display the data in a pretty HTML page:
Netflix’s OData backend runs on Windows Azure and SQL Azure to produce the OData feeds. OData being an open specification, there are many ways to build a “data producer”. Here are a few applications and services exposing OData feeds:
- SharePoint 2010
- SQL Azure
- Windows Azure Table Storage
- IBM Websphere
The complete list of currently available solutions is here: http://www.odata.org/producers. We clearly expect to see more OData producers coming for various platforms and languages.
How did we build the sample application?
You can watch the following Channel9 video with Claudio Caldato demoing and explaining the PHP sample. Claudio has been instrumental in driving the development of cross platform OData SDKs and building the OData community with Microsoft partners.
Using the oData SDK for PHP to consume an OData feed is really quick and easy. You have to consider two main steps:
1. Generating the proxy classes: the SDK includes a tool that will read the definition of the OData Service and create the corresponding PHP proxy classes. It will create one class per collection that is exposed by the service. You can see here all the collection available in the Netflix service:
2. The next step is to write the code for application logic. Your code will call the PHP proxy classes so that you can easily program against the OData.
Join the conversation
We’ve been working hard to get OData support on as many platforms as we can so a developer on any platform can both consume and produce these feeds. It’s only the beginning of the journey, and you can expect more to come. Of course, feedback is welcome!
To join the conversation, please visit www.odata.org.
Additional information to bookmark, two MIX10 sessions:
- OData: There’s a Feed for That, presented by Pablo Castro (video recording available soon)
- Implementing OData: How to Create a Feed for That, presented by Mike Flasko (video recording available soon)
— Jean-Christophe Cimetiere, Sr. Technical Evangelist