locked
OData and Windows Live Writer RRS feed

  • Question

  • When you create an OData WCF Data Service, is it automatically an AtomPub server that you could connect to with blogging tools like Windows Live Writer to create blog posts?
    Thursday, March 18, 2010 10:57 PM

Answers

  • From my experiment with the writable OData source that is listed here http://www.odata.org/producers the answer is no.  Windows Live Writer posts html as the content of the atom:Entry.  OData is expecting application/xml as the content type.  And more specifically, it is expecting XML using elements from the http://schemas.microsoft.com/ado/2007/08/dataservices/metadata namespace, if you put any other xml elements you will get a 500 error.  Not that you can tell that from the expected content type :-(  

     


    Darrel
    • Marked as answer by Alan.M Friday, March 19, 2010 7:28 PM
    Friday, March 19, 2010 2:52 PM

All replies

  • From my experiment with the writable OData source that is listed here http://www.odata.org/producers the answer is no.  Windows Live Writer posts html as the content of the atom:Entry.  OData is expecting application/xml as the content type.  And more specifically, it is expecting XML using elements from the http://schemas.microsoft.com/ado/2007/08/dataservices/metadata namespace, if you put any other xml elements you will get a 500 error.  Not that you can tell that from the expected content type :-(  

     


    Darrel
    • Marked as answer by Alan.M Friday, March 19, 2010 7:28 PM
    Friday, March 19, 2010 2:52 PM
  • Does anyone know if it is possible to change the content types that a producer will accept, or is application/xml hard coded in the framework?

    Friday, March 19, 2010 4:36 PM
  • Hi,

    If you implement Streaming provider/Media Link Entries for a given entity set, then your server can accept any mime type (you decide which one). See this or this for more details, or bing something like "Data Services Streaming provider".

    But I don't know what exactly BLOG writers (like the Windows Live Writer) uses to post the blogs and maintain them. It will very likely not udnerstand the OData parts as noted above by Darrel, but it only really just needs to POST an HTML, then that should be doable.

    Thanks,


    Vitek Karas [MSFT]
    Friday, March 19, 2010 5:33 PM
    Moderator
  • I get the feeling that OData/WCF Data Services hasn't really been made with building AtomPub blogging services in mind.  Maybe it is possible, but there don't seem to be any good examples right now that show how to do it and tie everything together.
    Friday, March 19, 2010 6:35 PM
  • We don't have a sample but I'm pretty sure that by using the stream provider as noted above and customizing the ATOM feed using Entity Property Mappings (msdn article) you should be able to make it work.

    Thanks,


    Vitek Karas [MSFT]
    Friday, March 19, 2010 7:36 PM
    Moderator
  • There's now a pretty detailed article about the streaming provider implementation here: http://blogs.msdn.com/b/astoriateam/archive/2010/08/04/data-services-streaming-provider-series-implementing-a-streaming-provider-part-1.aspx

    Thanks,


    Vitek Karas [MSFT]
    Thursday, August 19, 2010 11:30 PM
    Moderator