BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News WCF RSS Toolkit for Generating RSS 2 and Atom 1 Feeds posted

WCF RSS Toolkit for Generating RSS 2 and Atom 1 Feeds posted

The WCF RSS Toolkit has just been released. The RSS toolkit is a Windows Communication Foundation-based framework for generating RSS 2.0 and Atom 1.0 content feeds. Using this toolkit, developers can easily expose a service as an RSS or Atom feed; it supports exposing a service as an RSS 2.0 feed, Atom 1.0 feed and SOAP endpoint simultaneously. The toolkit can also be extended to support other wire formats. The version of the WCF RSS Toolkit is intended only for serving RSS and Atom feeds, the Windows RSS Platform is recommended for consuming such feeds.

Yasser Shohoud has also blogged some examples of how to use the toolkit:

using System;
using System.ServiceModel;
using System.Collections.Generic;
using Microsoft.ServiceModel.Samples.Syndication;
namespace Microsoft.ServiceModel.Samples.Syndication
{

    [ServiceContract]
    public class ItemListService
    {
       [OperationContract]
       
ContentFeed<FeedItem> GetItemList()
      
{

            //instantiate the feed
           
ContentFeed<FeedItem> feed = new ContentFeed<FeedItem>();

            //populate the list of feed items
           
feed.FeedItems = GenerateItemList();

            //set some feed-level properties
           
feed.FeedAuthor = wcfuser@contoso.com;
            feed.FeedTitle = "WCF Item List!";

            ...

            //return the feed
           
return feed;       

        }

        ItemList<FeedItem> GenerateItemList()

        {

            ItemList<FeedItem> list = new ItemList<FeedItem>(); 

            FeedItem item1 = new FeedItem();
            item1.ItemTitle = "This is item 1";

            ...

            list.Add(item1);

            ...

            return list;

        }

    }

}

Rate this Article

Adoption
Style

BT