Home > Articles > Web Services > XML

  • Print
  • + Share This
Like this article? We recommend

Like this article? We recommend

Browsing Entries

Browsing is just as easy. By retrieving an instance of feedType from the service.feed URL, a collection of entryTypes can be retrieved, each one relating to a blog entry, as shown in Listing 6.

Listing 6 Browsing entries.

if (service.srvType.Equals(serviceType.feed))
{
  feedType feed = atom.GetFeed(service.postURL);
  foreach (entryType entry in feed.entries)
  {
    Console.WriteLine("Entry " + entry.title + " was posted at " + entry.created
      + " by " + entry.author.name);
  }
}

Running this code on the blog in Figure 1 gives the following results:

Entry InformIT Test Post was posted at 2005-11-27T18:58:25Z by Tim Stevens
Entry Test Post was posted at 2005-08-25T21:52:31Z by Tim Stevens
  • + Share This
  • 🔖 Save To Your Account