I wrote this blog to give a possible workaround for RSS Web Part problems with certain feeds.
Did you ever try to connect a list feed to a SharePoint RSS feed web part? Well, I did, and it doesn’t work. The web part returned me a redirect error on public Internet sites and an authentication problem on secure Intranet sites.

The RSS web part is not able to handle secure RSS connections. After some debugging the problem of the redirect error was found in the fact, that certain RSS feeds are trying to return a cookie, which a web part normally does not accept. Because the cookie is not set, the RSS generator keeps redirecting the download request.
The cookie and authentication problems do not only apply to the SharePoint list feed, but also to a lot of other feeds on the internet.
The work around
To get correct RSS feeds in the standard SharePoint RSS feed web part, I’ve chosen to develop a small “proxy” handler to access the feed in Visual Studio.
To create the proxy, we’ll start with adding a “Generic handler” file to an empty web project. The generic handler item uses the extension .ashx. I won’t recommend using the normal “Web Form” (aspx) template, because it uses more resources than the simple handler. We simply don’t need all the page rendering technology of a web form to return some xml. Keep it light and simple!
The generic handler implements the IHttpHandler which defines 2 functions. The “IsReusable” boolean function is used to indicate if a single instantiation of our IHttpHandler can be used to process multiple concurrent requests. We will just leave this value on it’s default “false” value. The second function, the “ProcessRequest” function, is where all the magic happens.
In our “ProcessRequest” function we’ll add our code to download a RSS feed. Once we downloaded the feed we will pass it back to the browser or web part. Because we are controlling the download process of the RSS feed, we can now add additional code, that the standard web parts don’t have. We can add a cookie bag to accept cookies and we can set a higher redirect value to allow more redirects. If you bought a news RSS for your intranet which requires login credentials you would also be able to add them to the proxy code.
{
[WebService(Namespace = “https://edwin.vriethoff.net/”)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class RSSFeed : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
XmlReader feedReader = null;
//Create and configure httpRequest
HttpWebRequest httpRequest = (HttpWebRequest)WebRequest
.Create(“http://rss.cnn.com/rss/cnn_topstories.rss”);
httpRequest.MaximumAutomaticRedirections = 15;
httpRequest.UserAgent = “Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1)”;
httpRequest.CookieContainer = new CookieContainer();
//Set XMLReader settings
XmlReaderSettings readerSettings = new XmlReaderSettings();
readerSettings.IgnoreWhitespace = true;
//Download and load the feed
feedReader = XmlReader.Create(httpRequest
.GetResponse().GetResponseStream(), readerSettings);
XmlDocument rssDoc = new XmlDocument();
rssDoc.Load(feedReader);
//Output the xml
context.Response.ContentType = “text/xml”;
context.Response.Write(rssDoc.OuterXml);
}
public bool IsReusable
{
get
{
return false;
}
}
}
}
Of course, in our real project, we made the proxy a lot smarter. For example, I won’t recommend using a hardcoded RSS url inside the code.
If we host the proxy inside a secured SharePoint environment, there is a nasty little problem left; The standard RSS web part is not able to download RSS feeds that require login credentials. Because the proxy is located inside the secure SharePoint environment, IIS requests credentials from the web part. To fix this last step we have to tell IIS that the proxy file is allowed to be accessed anonymously.
Open the IIS manager on the server and locate the proxy file inside the web application. Now right-click the file and request it’s properties. Open the “File Security” tab and click the “Authentication and access control” Edit button. Just check the checkbox on the top to enable the anonymous access.
That’s it, save the settings and reset IIS. Now we only have to point the RSS web part to the ashx http location, and the feed will be downloaded!
February 19, 2009 at 11:48 pm
The problem is not the RSS feeds, but the proxy server on your network that checks to see if you have permissions, and adds the cookie to the session. On my network, I can add the RSS feed for CNN top stories without a problem (it is anon auth after all). Are you using BlueCoat proxy by any chance?
February 20, 2009 at 7:26 am
Hi Wes, Thanks for your reply. The CNN feed is indeed no problem as it is an anonymous feed without cookies. I just used their url als RSS example url to retrieve some rss. Regards Edwin
February 20, 2009 at 5:10 pm
I would like to point out that your solution does also solve a problem with some authenticating proxies that put a cookie on the session since they are checking each user and granting or denying access to the Internet (outbound). In this case, even sites like CNN or others will have issues, but it is the proxy causing it. Thanks for sharing.
February 20, 2009 at 6:15 pm
No problem, thanks!
February 25, 2009 at 2:46 pm
I’m interested in the comment from Wes – why is Bluecoat significant and does it cause problems?
For a client I am working with MOSS behind a bluecoat proxy using kerberos sign-on and origin-cookie-redirect authentication mechanism.
We’re seeing the first error shown at the top here (protocolError:found) when trying to access external RSS feeds.