BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

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

by Floyd Marinescu on Jun 15, 2006 |

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;

        }

    }

}

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT