D
dkode
I built an asp.net usercontrol that consumes rss feeds that I specify
the url for.
Some of them (MVP blogs, google news) consumes the feeds just fine. and
other times (75%) it chokes on stream.length and stream.position with
an Exception of type System.NotSupportException.
It seems as if with some RSS feeds, they are not formatted correctly?
What can I do to get these to work properly.
One that is giving me problems is the slashdot rss :
http://rss.slashdot.org/Slashdot/slashdot
I will put error reporting in there so if the feed is bad, it won't
consume it, but i'm just trying to figure out why it would choke on
these feeds. The RSS xml looks ok, so I dont really understand what the
problem is.
Any help would be greatly appreciate. here is a snippet of code i'm
using to consume the feed:
WebRequest request;
WebResponse response;
Stream stream;
XmlTextReader reader;
XmlDocument xmldoc;
request = WebRequest.Create(url);
response = request.GetResponse();
stream = response.GetResponseStream(); <--CHOKES HERE
// Create new XmlTextReader and XmlDoc
reader = new XmlTextReader(stream); <-- AND SOMETIMES HERE
xmldoc = new XmlDocument();
xmldoc.Load(reader);
Xml pageXML = new Xml();
pageXML.Document = xmldoc;
pageXML.TransformSource = "~/style/RSSReader.xsl";
// Add to plFeeds placeholder
this.plFeeds.Controls.Add(pageXML);
reader.Close();
stream.Close();
request = null;
response = null;
stream = null;
reader = null;
xmldoc = null;
the url for.
Some of them (MVP blogs, google news) consumes the feeds just fine. and
other times (75%) it chokes on stream.length and stream.position with
an Exception of type System.NotSupportException.
It seems as if with some RSS feeds, they are not formatted correctly?
What can I do to get these to work properly.
One that is giving me problems is the slashdot rss :
http://rss.slashdot.org/Slashdot/slashdot
I will put error reporting in there so if the feed is bad, it won't
consume it, but i'm just trying to figure out why it would choke on
these feeds. The RSS xml looks ok, so I dont really understand what the
problem is.
Any help would be greatly appreciate. here is a snippet of code i'm
using to consume the feed:
WebRequest request;
WebResponse response;
Stream stream;
XmlTextReader reader;
XmlDocument xmldoc;
request = WebRequest.Create(url);
response = request.GetResponse();
stream = response.GetResponseStream(); <--CHOKES HERE
// Create new XmlTextReader and XmlDoc
reader = new XmlTextReader(stream); <-- AND SOMETIMES HERE
xmldoc = new XmlDocument();
xmldoc.Load(reader);
Xml pageXML = new Xml();
pageXML.Document = xmldoc;
pageXML.TransformSource = "~/style/RSSReader.xsl";
// Add to plFeeds placeholder
this.plFeeds.Controls.Add(pageXML);
reader.Close();
stream.Close();
request = null;
response = null;
stream = null;
reader = null;
xmldoc = null;