Emil Stoichev's Blog

Just a few coding tips

Consume data from Astoria service using the Astoria Silverlight API

In my previous post I referred you to a tutorial how to make a simple line chart with Silverlight 1.1. With this chart we were able to load data from an exported Excel XML Spreadsheet or from a XML serialized list of Point objects. I thought it would be great if the chart can consume data from a web service and thus stay updated without any user intervention. I decided to use Astoria service - it is new, unexplored, easy to understand and to use, the payload is low, etc. I believe that Astoria will be used by a lot AJAX-enabled and rich internet applications. If you are not familiar with Astoria go to its official labs site and learn! The technology is still in an early development phase and there is yet only a CTP version but you can find enough info to get started. Also there is a couple of useful blogs: Project Astoria Team Blog, Mike Flasko's Blog, Pablo Castro's blog.

Yesterday I continued my series of articles regarding how to build a simple line chart with Silverlight 1.1 (read here). I explained how to make an ADO.NET Entity Model, create Astoria service and then consume it from Silverlight. The sample chart loads data from a Northwind database and then represents it in a line chart. It is a pretty straight-forward way to keep the chart alive. The source code is also included (ASP.NET 3.5 app + silverlight control library + silverlight project) so you can try and use it for your needs. Prerequisites: Visual Studio 2008 Beta2, the Silverlight 1.1 Alpha Tools, the Astoria toolkit (VS2008 Beta2 Refresh) and the ADO.NET Entity Framework Beta 2.

Comments

Glenn said:

I agree with you.  Astoria is the logical choice for AJAX rich web applications.  If you have to deal with a lot of JavaScript and HTML, do you really want to have to worry about anything MORE than a single URL to get your data?

# November 29, 2007 9:29 AM

Emil Stoychev said:

Exactly. Astoria supports exchanging entities in XML, JSON and RDF in XML (still very experimental) formats. JavaScript has built-in JSON serializer and now Silverlight also has. That makes Astoria just the right thing to use with your AJAX and RIAs.

# November 29, 2007 9:46 AM