I am developing a website that, among other things, provides blogs through the Metaweblog API. I got an API that works quite well with several blog clients, but Windows Live Writer is killing me.
I did a network trace to capture the actual reverse traffic. Here are the results:
WLW asks for my blog URL, username and password. URL: / item / list / type / blog / user / 1 / bloguser / 1 and I provide this.
I see that WLW is making an HTTP request for this url. He gets an answer. This answer includes both RSD and wlwmanifest tags.
The following WLW request is for / mwapi / rsd / bloguser / 1, which is the correct URL.
Answer - RSD response from MetaWeblog:
<?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 WLW request is / mwapi / index. This is a method call for blogger.getUsersBlogs. Request:
.<?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>
Sorry periods; this is a carriage return. I grab it from the network path.
The response from the server is also presented 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>.
It looks right to me. BlogID is correct, the URL is correct, and the blog name is correct.
Then WLW repeats the call to the getUsersBlogs method. He receives an identical response.
Then WLW appears: โA successful connection was made to your account, but the server said that you currently do not have an active blog. Please make sure your account with this provider is current before proceeding."
WLW has not completed any additional HTTP requests except those that I described here.
Any clues what am I doing wrong? I ensured that the wlwmanifest.xml file is accessible, and in fact any wlwmanifest.xml request (e.g. / this / is / not / it / wlwmanifest.xml) will still return the correct file.
EDIT: I realized that I am not returning an array from the getUsersBlogs method. When I changed this, the HTTP response from the method call:
.<?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>.
It looks like described in http://msdn.microsoft.com/en-us/library/aa905665.aspx as a sample response. But WLW displays an error - "The reference to the object is not installed in the object instance." Again, the actual response data does not include periods - the way Network Monitor represents the carriage return.
I made test calls from a test harness and it works fine with the same answers. And, as I said, it works with other blog clients. Reference.