news feed using .Net Dataservices / OData / Atom ?

Posted by Stephan on Stack Overflow See other posts from Stack Overflow or by Stephan
Published on 2010-05-21T10:21:28Z Indexed on 2010/05/26 17:01 UTC
Read the original article Hit count: 316

Filed under:
|
|

Let's say I have an web CMS type application, and an EDM model with an entity called 'article', and I need to offer

  1. the ability for client applications, to a read/query the articles (and other resources stored in our database)
  2. a straightforward syndication feed of these articles to end users (along the lines of a simple RSS feed)

It seems to me that for the first task, and .net 4's dataservice would be perfect for the job. For the second case, I'm wondering (a) whether atom the right format to choose - I think it is - and (b) whether it's possible to achieve such a feed using the same ado.net OData service.

I took a look at some of the examples out there and briefly set up a proof of concept:

http://localhost/projectname/DataService.svc/Articles

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="http://localhost/projectname/DataService.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <title type="text">Articles</title>
  <id>http://localhost/projectname/DataService.svc/Articles</id>
  <updated>2010-05-21T09:41:22Z</updated>
  <link rel="self" title="Articles" href="Articles" />
  <entry>
    <id>http://---------DataService.svc/Articles(1)</id>
    <title type="text"></title>
    <updated>2010-05-21T09:41:22Z</updated>
    <author>
      <name />
    </author>
    <link rel="edit" title="Article" href="Articles(1)" />
    <category term="Model1.Article" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/xml">
      <m:properties>
        <d:int_ContentID m:type="Edm.Int32">1</d:int_ContentID>
        <d:Titel>hello world</d:Titel>
        <d:Source>http://www.google.com</d:Source>
      </m:properties>
    </content>
  </entry>
</feed>

and noticed that, though the feed works and items are showing up, the title tag on the entry level is left blank. (as a result, when you check this feed in a feed reader, you will see no title). I searched msdn but haven't found a way to do that, but it should be possible. Stackoverflow itself uses an atom feed in that fashion, so it should be possible. Right?

So I suppose my question is; Is there a way to make the ado.net dataservice Atom feed look like something suitable for your average news feed reader? - OR, am I using the wrong tool for the wrong purposes, and should I be looking elsewhere (.net syndication API's perhaps)?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about ado.net-data-services