.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Consuming an RSS Feed

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

I'm looking to make a user control to display the 3 most recent posts from a blog on my home page. I've googled around a bit and found a few ways to do this, but none I'm quite satisfied with.

I looked at the XMLDataSource control, but I'm concerned about exception handling. If the remote feed fails, I want to just hide the usercontrol and let the rest of the page display as normal. There seems to be no clean, declarative way to handle this. An OnError event would be nice, especially if it had an e.ExceptionHandled property on the EventArgs object like some of the other DataSource classes.

Scott Guthrie blogged about an RSS Toolkit for .net 2, but that was four years ago and hasn't been updated.

I'm leaning towards Linq to XML, which would probably work fine, but I can't help thinking that there must be a simpler approach to reed RSS feeds since it's such a common problem.



View Complete Post

More Related Resource Links

Consuming RSS Feed using ASP.NET

 i'm trying to consume RSS Feed using ASP.NET with c# as followsConsuming RSS Feed using ASP.NET   <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"><title>RSS Feed</title> </head> <body> <form id="form1" runat="server"> <div> <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile=http://feeds.feedburner.com/mathrubhumiXPath="rss/channel/item"></asp:XmlDataSource> </div> <asp:DataList ID="DataList1" runat="server" DataSourceID="XmlDataSource1" BackColor="White" BorderColor="#404040" BorderStyle="Solid" GridLines="Vertical"> <ItemTemplate> <%#XPath("title")%><br /> <%#XPath("pubDate")%><br /> <%#XPath("author")%><br /><%#XPath("description")%> </ItemTemplate> </asp:DataList> </form> </body> </html>  &nb

Consuming WCF Data Service feed in WF 4.0



We have created a custom Odata service overriding base implementation, including metadata generation. The service is hosted in IIS7, Win2k8 Hyper-without V servers. We wish to use WF 4.0 for implementing various caching strategies i.e. read-ahead, on-demand caching in asynchronous manner. The service requires authentication information to be passed , so looking for help in designing the solution and appropriateness of WF 4.0 as a choice.



Samir P

Generate rss feed with HTTPHandler





I'm looking for link/tutorials/code samples on How to create HttpHandler for generating rss feeds for a website.




problem in consuming WCF service through Window application


I have a silverlight application and WCF service all made in VS 2010 , i had hosted my site to web server which contain Window 2008 and IIS 7.0

now the problem is i have another application which is a window application developed in VS2008 , when i try to add the service reference it gives me error


The document at the url was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://dev_qa.emspa.com/HRDev3/Service.svc?disco'.'.

  - The request failed with HTTP status 400: Bad Request.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from '' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: ''.

Content Type application/soap+xml; charset

Service Station: Creating And Consuming Web Feeds


Jon Flanders demonstrates creating and consuming Web feeds with Windows Communication Foundation and AtomPub.

Jon Flanders

MSDN Magazine April 2009

Inside MSDN: Consuming MSDN Web Services


Get the inside track on how the MSDN team uses Web Services to power MSDN2.

Craig Andera

MSDN Magazine October 2006

Consuming External Data Using SharePoint Server 2010 Business Connectivity Services and an Excel 201

Learn how to use BCS in SharePoint Server 2010 to access and update external data by using Microsoft Excel 2010 as a client.

Video: Consuming SharePoint 2010 Objects and Data in Silverlight Applications

This video provides an overview of how to build Silverlight applications that access SharePoint data. (Length: 3:50)

Video: Consuming SharePoint 2010 Data from Remote Applications

This video provides an overview of how to build remote applications for SharePoint. (Length: 4:55)

Unable to read my RSS feed with XmlReader



I have an RSS-feed page, which I developed with SyndicationFeed class. The page seems to work, and if I type the url into a browser, a page similar to this opens up: http://msdn.microsoft.com/en-us/magazine/rss/default.aspx

However, I'm unable to read the feed into an XmlReader object. Let's say my rss page is "http://mysite/rss.aspx", and my code in the rss-retriever side is something like this:

XmlReader reader = XmlReader.Create("http://mysite/rss.aspx");

XmlDocument doc = new XmlDocument();


I get an error on doc.Load(reader) method:

For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on XmlReaderSettings to false and pass the settings into XmlReader.Create method

I've tried to set the ProhibitDtd to false, but then I get some other error.

If I put something like this, I can save the xml dat into a file, and I can see that it's just like it should be:

XmlReader reader = XmlReader.Create("http://mysite/rss.aspx");

SyndicationFeed feed = new SyndicationFeed();

Consuming a PHP service.


I'm working with an outside company to impletement their API into our program. Most of their member functions working pretty solid. I get to the one function where I have to pass an associated array to it and this is where it blows up. I create a hash table or namevaluecollection and of course I will get the error(The type System.Collections.Hashtable is not supported because it implements IDictionary.), which can't be serialized.

Is there an easy way to pass this associated array to them? I don't think their api is very flexible, but they seem to think so.

Error Consuming Web Service - Unable to import binding xxx from namespace ...


In VS2008 / C# / ASP.NET 3.5, I wrote a test web service app. Here is an extract from the code:

namespace emed.MathWebService
    /// <summary>
    /// Sample Math Services For Learning Web Services Deployment
    /// </summary>
    [WebService(Namespace = " http://localhost/MathService")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class MathService
        public float Add(float a, float b)
            return a + b;


I have published this to an IIS virtual directory named MathService, and when I try to launch it with the URL http://localhost/mathservice/MathService.asmx is works fine and displays all the operations (Add, Subtract etc) in the service.

I then created a test web application in VS2008 (named WebSvcTe

Consuming a WCF Service using SSL

I have a WCF Web Service that has been created with VS2010 using Framework 4.0.  The service accepts an XML file along with a user and password. The service performs exactly as it should until I turn on "Require secure channel" on the virtual directory.  I was receiving errors relating to the endpoints, however, now I have fixed those issues and receive a different error. I have created a separate web site project to consume the web service, again using VS2010.  When I select the button to invoke the call, I receive "The request failed with HTTP status 404: Not Found". The stack trace is as follows: [WebException: The request failed with HTTP status 404: Not Found.] testservice._default.ws_LoadAOCDataCompleted(Object sender, LoadAOCDataCompletedEventArgs e) in c:\my documents\visual studio 2010\Projects\AOCSvc\testservice\default.aspx.vb:38 testservice.aocsvc.AOCService.OnLoadAOCDataOperationCompleted(Object arg) in c:\my documents\visual studio 2010\Projects\AOCSvc\testservice\Web References\aocsvc\Reference.vb:104 System.Web.AspNetSynchronizationContext.CallCallbackPossiblyUnderLock(SendOrPostCallback callback, Object state) +73 I am new to web services as well as WCF and Framework 4.0.  Again, the service works correctly until I turn on SSL. Any ideas on what may be "locking" the service?  I have rea

Error in consuming web service using WCF client

Hi, I have consumed an external webservice in my client application using WCF. And every thing works great in my Dev box(XP with IIS5.1) But when the same application is moved to Prod server(Win Server 2003 with IIS6.0) it fails. Below is the exception caught: There was no endpoint listening at http://MyExternalWebServiceUrlWithSessionId could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. And the InnerException is: Unable to connect to the remote server My Config file has the below settings:<system.serviceModel> <bindings> <basicHttpBinding> <binding name="Default_Binding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCoun

Consuming restful api (like that of basecamp from asp.net applications)

Hi How  can i Consume or use  restful api (like that of basecamp from asp.net applications)from my my .Net projects.Thanks Sagar.

consuming a web service in silverlight

Hi all,      I am new to silverlight. I have to develop an application where I have to consume a web service http://www.xignite.com/xRealTime.asmx?WSDL to display the real time stock price on a data grid in the silverlight application. Can anyone please tell me if it is possible and if the answer is yes how do I go about it.If the answer is no please tell me what is the best way to display these values using a silverlight application.     
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend