Summary
Most feeds are going to be accessed across domains. This means that a feedâs domain must contain a cross-domain policy file that permits the feed to be accessed by the Silverlight clientâs hosted serverâs domain. If the cross-domain policy file does not exist on the hosted domainâs server, you can use services that support open cross-domain policies, such as FeedBurner, Yahoo! Pipes, and Popfly, to effectively relay the feed to the Silverlight client application.
Silverlight 2 applications can read RSS and Atom feeds using
WebClient
or HttpWebRequest
and can consume them
using the SyndicationFeed
class, LINQ
to XML, or the XmlReader
. The
SyndicationFeed
class offers the most
features for the least amount of work, as it encapsulates a lot of the
functionality required to read and manage feed data, which is
effectively a form of POX.
This chapter demonstrated how to consume feeds, mash them together, and work around the lack of cross-domain policy files. The next chapter discusses how to use ADO.NET Data Services and its RESTful style to communicate with Silverlight 2.
Get Data-Driven Services with Silverlight 2 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.