Monday, 27 July 2009

OpenNETCF.Rss and SDF 2.3

A question was asked on the MSDN Smart Device Development Forum this morning regarding Synchronization using RSS (http://bit.ly/L88qA). I responded with a number of links to the OpenNETCF's SDF documention for their RSS namespace and a link to Alex Yakhnin's blog post "Taking OpenNETCF.Rss for a spin." (http://bit.ly/XHsjp).

I am a keen subscriber to a number of blog posts via this mechanism so I have an interest in this, I even subscribe to various blogs on my HTC Diamond device, so I wanted to know more about this namespace. I didn't have much time this morning to have a play with Alex's example application so I had a look after work.

As the SDF now includes the OpenNETCF.Rss namespace I opened Alex's example and removed the OpenNETCF.Rss project and referenced the OpenNETCF.Rss namespace from the SDF2.3 installation on my machine. Building this then lead to a number of build errors relating to other changes in the SDF, I didn't really have time to correct all the build errors and all I really wanted to do was to prove that I could download some data via this mechanism so I started a new solution that would just download the name of the feed and the names of the feed items. I may come back to this and correct the other build errors at some point.

I started writing some code however ran into a problem with a configuration I needed to provide, which Alex's example provided. After loading the config file into an XmlDocument I then proceeded extracting the relevant XmlNode and passing it to the StorageConfiguration.Load and TransportConfiguration.Load methods.

The second issue I came across was that the version of the OpenNETCF.Rss assembly was slightly out of date in Alex's config file so I updated it from 1.0.0.0 to 2.3.0.39.All was going well, the config was loaded successfully, now all I needed to do was to call the Receieve method on a valid RSS feed URL. I tried my Twitter account however that requires additional user credentials, I then tried the MSDN forum however that didn't work (it didn't seem to work in Snackr either, but thats another story), I then tried Neil Cowburn's blog (http://bit.ly/166fYW) and that worked successfully.

I now have the title of the Feed in a label and the titles of the Feed Items in a listbox.