My Headlines

Wednesday, August 8, 2007

Silverlight + Astoria= Powerful Web Services and Data Access

by Don Burnett

A lot of people have heard about Astoria by now, it was introduced by Pablo Castro at Mix'07, it's goal is to let you enable applications to expose data as a data service that can be consumed by web clients within a corporate network and across the internet. The data service is useable over HTTP, and URIs are used to identify the various pieces of information available through the service.

Interactions with the data service happens in terms of HTTP verbs such as GET, POST, PUT and DELETE, and the data exchanged in those interactions is represented in simple formats such as XML and JSON.

That is great for Ajax web developers, but for a lot of people looking to do Silverlight development getting data into the Silverlight plug-in hasn't been easy at best and it's been a matter of just message passing over JavaScript.

However this week Silverlight got a new friend in the Astoria Silverlight Client API. It is a new client library that makes it possible to access Astoria data sources from within Silverlight. This gives Silverlight it's first rich data access capability and opens up Silverlight applications to consuming whole new sources of data directly.

This week the folks at MS Live Labs allow us to extend this further by creating our own database and web service online by defining the web service entity model, which you can also do at http://astoria.livelabs.com/OnlineService.aspx. This is cool because they let you test it out online, but if you must, you can also download the toolkit and play with it from within SQL Server Express and Visual Studio 2008 beta.

It's not much different than using Access or SQL server to define tables and keys, relationships and fields and can be done from the web page after this you are done and you are given back connectivity to the webservice via a URL.. My sample looks like this.. (this is post defining my entity model)..

https://astoria.sandbox.live.com/users/donburnett/donburnett.rse

<?xml version="1.0" encoding="utf-8" ?>
<DataService xml:base="https://astoria.sandbox.live.com/users/donburnett/donburnett.rse">
<Container uri=".">
<Customers href="Customers" />
</Container>
</DataService>

It's very easy to create an Astoria data service, the URL requires sign-in to windows live (formerly passport), adding great security as well..

Astoria, although a research product at the moment has much promise, and anyone interested in quickly adapting SQL data base to web services or easily creating new web based data services. Because it works over HTTP is is both efficient and beautiful. The new Silverlight client library gives transparent access to this very cool data service functionality. Microsoft wants you to play with it too. I suggest you go over there and try it. It seems like a great solution for Silverlight. It does require the latest version of Silverlight 1.1 to work with the library.. If you want data access to data services/web services I really recommend you check this out..

1 comment:

Chris Woodruff said...

Don -- You beat me to the Astoria project. But I am finding a great combo between the Acropolis project and Astoria. :)