Add to My Yahoo! | Google Reader or Homepage | Add to Windows Live | Add to Windows Live Alerts

Wictor Wilén

Microsoft Certified Master (MCM) - SharePoint 2010 | Microsoft Most Valuable Professional (MVP) - SharePoint Server MVP | Author

Custom implementation of the Metaweblog API and Windows Live Writer

Posted at 2006-09-03 03:03 by Wictor Wilén in XML , Windows Live Writer with 6 comments.

This blog has been powered by my own custom implementation of the Metaweblog

API
, because I wanted to test Windows Live Writer. As I posted before the current implementation of the Metaweblog API by WLW is not correct in the beta. According to the WLW newsgroup, on this issue, the team are taking a second look at the Metaweblog specifications. Funny thing is that WLW does not even follow the specifications found at MSDN.

The big problem is the metaWeblog.getCategories method which should return the categories of a specific blog. The response should, according to the Metaweblog specs, contain description, htmlUrl and rssUrl, but Windows Live Writer wants a response with categoryid and title. It seems like all of the different blog providers implemented by WLW has this issue; Movable Type (mt.getCategoryList expects categoryId and categoryName) and even Windows Live Spaces (which uses the metaWeblog.getCategories).

Today I got a comment on a previous post from Michael Ekegren who also stumbled upon the same problem as I did. So, if you would like to use WLW to your own homebrewed Metaweblog API, you have to return a response like this to the metaWeblog.getCategoris XML-RPC call.

Disclaimer: This is just how I got it to work on the current beta of Windows Live Writer and this will probably get fixed in the future and it is not the way it should be done according to the Metaweblog specifications.

1 <?xml version="1.0"?> 2 <methodResponse> 3 <params> 4 <param> 5 <value> 6 <array> 7 <data> 8 <value> 9 <struct> 10 <member> 11 <name>categoryid</name> 12 <value>1</value> 13 </member> 14 <member> 15 <name>title</name> 16 <value>Category 1</value> 17 </member> 18 </struct> 19 <struct> 20 <member> 21 <name>categoryid</name> 22 <value>2</value> 23 </member> 24 <member> 25 <name>title</name> 26 <value>Category 2</value> 27 </member> 28 </struct> 29 </value> 30 </data> 31 </array> 32 </value> 33 </param> 34 </params> 35 </methodResponse>

Another problem with the categories in WLW is that the metaWeblog.getPost and  metaWeblog.getRecentPosts shall return an XML-RPC struct for the categories for each post. Accordning to the specification the struct should contain an array of the titles of the catgeories as below:

1 <member> 2 <name>categories</name> 3 <value> 4 <array> 5 <data> 6 <value>Category 1</value> 7 <value>Category 2</value> 8 </data> 9 </array> 10 </value> 11 </member>

But Windows Live Writer expects it to be an array of the id's of the categories instead, like this:

1 <member> 2 <name>categories</name> 3 <value> 4 <array> 5 <data> 6 <value>1</value> 7 <value>2</value> 8 </data> 9 </array> 10 </value> 11 </member>

Hope this helped someone out there :-). If not I have it all documented so I know why I did this when there is a new version of Windows Live Writer out...

Comments and trackbacks

#  Up and running with the MetablogAPI by Trackback
Screenshot from websnpr
#  New beta - metaWeblog.getCategories still not fixed? by Hans Nordhaug
Screenshot from websnpr Thx for this excellent post. There is a new beta of Windows Live Writer out and they claim that metaWeblog.getCategories is fixed. However, I still get the same error... Could you have a look at it, please? PS! I posted a comment about this on their announcement post at http://windowslivewriter.spaces.live.com/ and J.Cheng, one of the developers, wrote Wictor, are you sure the getCategories is not fixed? I was told we're taking the description now if it's available (but if title is included we use that value instead). (I linked to your site and he thought I were you - not intended.)
#  Windows Live Writer 1.0 beta and Metaweblog API by Trackback
Screenshot from websnpr Windows Live Writer has been upgraded and I wrote a post on the Metaweblog standard conformance of WLW in a previously. The metaWeblog.getCategories I suggested to use to get it to work with Windows L...
#  getCategories by Wictor
Screenshot from websnpr Hans: check my latest post
#  Windows Live Writer Updated once again by Trackback
Screenshot from websnpr The Windows Live Writer has once again been updated, it’s still a Technical Preview. The new and updated version contains numerous improvements to the interface and introduces a brand new plugin model...
#  Good site by Patrick J.
Screenshot from websnpr Hi ! Here you can find Horiscope And here is Friends dating site. This is another interesting Zodiac signs compatibility
Make a comment on this post:
Subject:  

Your name:  
Your Url:  
Note: submissions may have to be approved before being visible, so don't submit your comment multiple times.