using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data;
using System.Configuration;
using System.Net;
using System.Xml;
using System.IO;
namespace RssReader
{
[WebService(Namespace = "http://zzzz.org")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class WebService1 : System.Web.Services.WebService
{
[WebMethod]
public rssItem[] rssFeedGen(){
WebRequest MyRssRequest = WebRequest.Create("http://www.coldfusionbloggers.org/rss.cfm?max=20");
WebResponse MyRssResponse = MyRssRequest.GetResponse();
Stream MyRssStream = MyRssResponse.GetResponseStream();
// Load previously created XML Document
XmlDocument MyRssDocument = new XmlDocument();
MyRssDocument.Load(MyRssStream);
XmlNodeList MyRssList = MyRssDocument.SelectNodes("rss/channel/item");
rssItem[] result = new rssItem[MyRssList.Count];
// Iterate/Loop through RSS Feed items
for (int i = 0; i < MyRssList.Count; i++){
result[i] = new rssItem();
result[i].Title = MyRssList.Item(i).SelectSingleNode("title").InnerText;
result[i].Author = MyRssList.Item(i).SelectSingleNode("author").InnerText;
result[i].Link = MyRssList.Item(i).SelectSingleNode("link").InnerText;
}
return result;
}
}
public class rssItem{
public String Author, Title, Link;
}
}