windows-live-writermetaweblog

Why isn't Windows Live Writer working with my MetaWebLog API provider?


I'm developing a Web site that, amongst other things, provides blogging via Metaweblog API. I've gotten the API working quite well with several blog clients, but Windows Live Writer is killing me.

I've done a network trace to capture the actual back-and-forth traffic. Here's the results:

WLW asks for my blog URL, user name, and password. The URL is /item/list/type/blog/user/1/bloguser/1, and I provide this.

I see WLW make an HTTP request for that URL. It gets a response. That response includes both RSD and wlwmanifest link tags.

The next request from WLW is for /mwapi/rsd/bloguser/1, which is the correct URL.

The response is the MetaWeblog RSD response:

<?xml version="1.0" encoding="UTF-8"?>
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
<service>
<engineName>Cahoots2</engineName>   
<engineLink>http://sourceforge.net/projects/cahoots/</engineLink>  
<homePageLink>http://10.0.1.39:8888</homePageLink>
<apis>
  <api name="MetaWeblog" blogID="1" preferred="true" apiLink="http://10.0.1.39:8888/mwapi/index" />
 </apis>
</service>
</rsd>

The next request from WLW is to /mwapi/index. This is the method call to blogger.getUsersBlogs. The request is:

.<?xml version="1.0" encoding="utf-8"?>..
<methodCall>.. <methodName>blogger.getUsersBlogs</methodName>.. 
<params>..  <param>..   <value>..
<string>ffffffabffffffce6dffffff93ffffffac29ffffffc9fffffff826ffffffdeffffffc9ffffffe43c0b763036ffffffa0fffffff3ffffffa963377716</string>..
</value>..
</param>..
<param>..
<value>..
<string>CommunityAdmin</string>..
</value>..
</param>..
<param>..
<value>..
<string>password</string>..
</value>..
</param>.. </params>..</methodCall>

Forgive the periods; those are carriage returns. I'm grabbing this from a network trace.

The response from the server is also in XML:

.<?xml version="1.0" encoding="UTF-8"?>.<methodResponse><params><param><value>
<struct><member><name>blogid</name><value><int>1</int>
</value></member><member><name>url</name><value>
<string>http://10.0.1.39:8888/item/list/type/blog/user/1/bloguser/1</string>
</value></member><member><name>blogname</name><value>
<string>CommunityAdmin @ Cahoots!</string></value></member></struct></value>
</param></params></methodResponse>.

This looks correct to me. The BlogID is correct, the URL is correct, and the blog name is correct.

WLW then repeats the original getUsersBlogs method call. It gets an identical response.

WLW then displays, "A successful connection was made to your account however the server reported that you do not currently have an active blog. Please ensure that your account with this provider is current before proceeding."

WLW has made no further HTTP requests beyond the ones I've described here.

Any clues whatsoever what I'm doing wrong? I've ensured that a wlwmanifest.xml file is available, and in fact any request for wlwmanifest.xml (e.g., /this/is/not/it/wlwmanifest.xml) will still return the correct file.

EDIT: I realized I wasn't returning an array from my getUsersBlogs method. When I changed that, the HTTP response from the method call was:

.<?xml version="1.0" encoding="UTF-8"?>.<methodResponse><params><param><value><array><data><value>
<struct><member><name>blogid</name><value><int>1</int></value></member>
<member><name>url</name><value>
<string>http://10.0.1.39:8888/item/list/type/blog/user/1/bloguser/1</string>
</value></member><member><name>blogname</name><value>
<string>CommunityAdmin @ Cahoots!</string></value></member></struct></value>
</data></array></value></param></params></methodResponse>.

This looks identical to what's described at http://msdn.microsoft.com/en-us/library/aa905665.aspx as a sample response. But, WLW displayed an error - "Object reference not set to an instance of an object." Again, the actual response data doesn't include the periods - that's just how Network Monitor represents carriage returns.

I've done test calls from a test harness and it's working fine with identical responses. And, as I said, it's working with other blogging clients. Help.


Solution

  • WLW, it seems, is VERY picky about the MWA implementation. I was not capitalizing one of the method names correctly.