In PDC09 (a Microsoft event for professional developers), Microsoft announced a project codename “Dallas” offering the world a marketplace of information services. In this marketplace, providers make available their information services for consumption in a variety of ways by developers and information workers to build applications. Those information services are available to multiple platforms (REST based model with Atom 1.0 feeds) and are delivered by Microsoft’s cloud computing platform – Windows Azure Platform.
With “Dallas”, you can subscribe to premium content that represents data such as weather, crime, food production and consumption, maps, universe, news, demographics, etc. “Dallas” gives both parties (providers and consumers) billing services to measure data usage accordingly. You can learn more from the following video, and go to “Dallas” website.
I wanted to play with this data, and build an application that consumes NASA’s information service offering exploration data and 3D images of Mars (currently as a trial). Also, I wanted to show that in a Silverlight application instead of a normal one and present some quick dives into Blend to make it better looking.
Part 1: Exploring “Dallas” Information Services
To connect to “Dallas”, you need to register and get an invitation code. With that, you can login with your Windows Live ID and “Dallas” will provide you with a secret key and unique user ID that will enable you to connect to its services. To get started, please visit Developer Quick Start.
I’m registered already, and I can navigate to the Catalog where I can subscribe to content I need. I will be using “Selected NASA Mars Exploration Rover 3D Images (Trial Offer)” and below shows it in my subscriptions:
Let’s click on “Click here to explore the dataset” and explore a little bit what we’re going to consume.
Go ahead and click the Preview button, and you’ll be presented by rows of data on the right side.
On the left, you can tweak your data inquiry by providing parameters, paging, credentials, and returned format (choosing from Atom or Raw formats). On the display view, you can reformat your data in tabular (the default), Atom 1.0, or Raw whichever suits you.
Now, let’s choose to retrieve one of the returned images. Go ahead and choose “Retrieve Image” in the series dropdown, under Service parameters. Remember to copy one of the image names returned in the previous step, and paste that in the Image name field.
If you try to click “Preview”, it will tell you that you need to use “Invoke” method to retrieve non-XML data (image in this case), so click “Invoke As” and you’ll be presented with the image requested:
One last piece in the service explorer that is important for next steps. On the bottom left corner, you’ll see a box that details on how this is being accessed:
- Request URL, which you can copy to use in your code or browser
- Headers used to authenticate your access to the information service. Those are passed as HTTP headers, and are the ones that differentiate access to “Dallas” services.
- Account key: the secret to access “Dallas” data
- Unique user id: identifies the user accessing the data, and useful if you have multiple users accessing via your account.
- Download C# Service classes is basically a generated code of a service proxy (or a number of them) to enable you to include in your project and use.
If you have your own account, then you can go ahead and subscribe to other datasets and play around with the results.
Next we’ll explore how to consumer this data in Excel, without writing a single line of code!
Part 2: Connecting as an Information Worker (no code at all)
You may have noticed that there is a button we haven’t talked about: “Analyze”. This button enables you to invoke the dataset inside Excel 2010 with PowerPivot add-on installed, which will enable to play with the data, analyze, and add visual elements if needed. Before you go on, you need to get hold of a beta version of Microsoft Office Excel 2010 (Go to Microsoft Office 2010 BETA). Once installed, you need to get the PowerPivot for Excel 2010 (a data analysis add-in with great BI computational power), which is required to analyze “Dallas” data.
If you’re ready, go to the service explorer of NASA’s 3D images of Mars, and click “Analyze”. You’ll be prompted to open a file, and to allow the program to run. PowerPivot for Excel will launch, and a dialog is presented to import the data feed. Finish the dialog, and you should be presented with a successful import of 100 rows (the maximum for trial services):
Click Close, and the data will be ready for you to analyze in PowerPivot:
Of course, not much of a data we have here. But imagine millions of rows demographics data, special data, or alike where you nee
d to generate summary reports, pivots, and charts. All that is possible with data available online and on demand!
Next, we’ll explorer the dataset of Mars 3D images, but this time in code. We’ll build a quick WPF application to do that. Stay tuned!