Reputation: 143
Iam developing a application in which i have used a . net browser to display a web page of feed . from that web page Iam storing the latest pub date but after 2 min its giving 503 exception . my code is as follow . how can i get rid of this exception
var URL = "http://feeds2.feedburner.com/plasticsnews/plasticsinformation/plastopedia";
System.Xml.Linq.XDocument feeddata = System.Xml.Linq.XDocument.Load(URL);
var maxPubDates = (from item in feeddata.Descendants("item") select item);
Upvotes: 0
Views: 423
Reputation: 12346
HTTP error 503 means Service Unavailable, therefore your code is not buggy but there is some kind of server error!
Best Regards
Upvotes: 0
Reputation: 1062745
If your C# is running at the client, but it is the server that is breaking... then unless you are accidentally triggering things like DOS detection (or simply overloading the server) I'm not sure what you can do.
I'm also not quite sure how your "browser" comment ties in with XDocument
(since they are orthogonal).
The first thing to try, I guess, is to read the feed once only and cache it; don't keep hitting the server.
Upvotes: 1