As part of our application, we need to download a RSS feed. Our client's have an internal RSS feed which works fine with IE/Firefox but doesn't work with our application.
The application try to download from a url. I am not sure what exactly wrong here:
RssChannelDom DownloadChannelDom(string url)
{
RssChannelDom dom = null;
System.Net.Cache.RequestCachePolicy policy =
new System.Net.Cache.RequestCachePolicy(
System.Net.Cache.RequestCacheLevel.BypassCache);
WebClient client = new WebClient();
client.CachePolicy = policy;
client.Headers.Add("User-Agent", "Mozilla/4.0");
byte[] feed = client.DownloadData(url);
// parse it as XML
XmlDocument doc = new XmlDocument();
doc.Load(new MemoryStream(feed));
return dom;
}
The client URL looks like:
http://sampleclient/diapatents/index.php/Special:Ask/
-5B-5BCategory:Patent_Alert
-5D-5D-20-5B-5BResearch-20Unit::Allergy_and_Respiratory
-5D-5D-20-5B-5BOrganisation::
-5D-5D-20-5B-5BTarget::
-5D-5D-20-5B-5BIndication::
-5D-5D-20-5B-5BDate::
-20-3E-20-0A-5D-5D-20-5B-5BRevised-20Since::
-20-3E-20-0A2009-2D8-5D-5D/sort-3DDate/order-3DDESC/
format-3Drss/rsstitle%3DPfizerpediaPatents/rssdescription-3DRSS-20Feed:
-20Allergy-20and-20Respiratory-20recently-20uploaded-20or-20revised/
limit%3D400