WCF RSS Sample

Mark is looking for some sample code for the recently released WCF RSS Toolkit. I've put the readme up here. I won't repeat the whole readme here but here's a peek at the programming model. There are several shortcuts for feeds from databases and feeds using existing data types so you should really check out the readme.

An example service:

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

    public class ItemListService
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";




            return list;




To expose RSS, Atom and SOAP endpoints in code (see readme and samples in toolkit for config-based and hosting in IIS examples):

using System.ServiceModel;
using Microsoft.ServiceModel.Samples.Syndication;
namespace Microsoft.ServiceModel.Samples.Syndication

    class Program

        static void Main(string[] args)

            ContentFeedHost host = new ContentFeedHost(
                new Uri("http://localhost:8077/ItemListService"));

            //endpoints defined in code

            // RSS endpoint will be listening at
            host.AddRssEndpoint(typeof(ItemListService), "rss");

            // Atom endpoint will be listening at
            host.AddAtomEndpoint(typeof(ItemListService), "atom");

            // WS-* SOAP endpoint will be listening at

                                    new WsHttpBinding(),


            Console.WriteLine("Service started ...");
            Console.WriteLine("Press [Enter] to exit");







Comments (6)

Cancel reply

  1. OPC Diary says:

    WCF RSS Toolkit (Microsoft) http://wcf.n

  2. Last week we put up a sample named WCF RSS Toolkit on wcf.netfx3.com and I posted a sample service using…

  3. Firstly a thanks to all those who attended my session on Wednesday and to the good conversations that

Skip to main content