为什么 Windows Live Writer 不与我的 MetaWebLog API 提供程序配合使用?

发布于 2024-08-12 01:47:24 字数 3791 浏览 11 评论 0原文

我正在开发一个网站,除其他外,它还通过 Metaweblog API 提供博客。我已经让 API 在几个博客客户端上运行得很好,但 Windows Live Writer 却让我很苦恼。

我已经完成了网络跟踪以捕获实际的来回流量。结果如下:

WLW 询问我的博客 URL、用户名和密码。 URL 是 /item/list/type/blog/user/1/bloguser/1,我提供了这个。

我看到 WLW 对该 URL 发出了 HTTP 请求。它得到回应。该响应包括 RSD 和 wlwmanifest 链接标记。

来自 WLW 的下一个请求是针对 /mwapi/rsd/bloguser/1,这是正确的 URL。

响应是 MetaWeblog RSD 响应:

<?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>

来自 WLW 的下一个请求是 /mwapi/index。这是对 blogger.getUsersBlogs 的方法调用。请求是:

.<?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>

原谅月经;这些是回车符。我正在从网络跟踪中获取此信息。

服务器的响应也是 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>.

这对我来说看起来是正确的。 BlogID 正确,URL 正确,博客名称正确。

然后,WLW 重复原始的 getUsersBlogs 方法调用。它得到相同的响应。

WLW 随后显示​​:“已成功连接到您的帐户,但服务器报告您当前没有活动博客。请确保您在该提供商处的帐户是最新的,然后再继续。”

除了我在此描述的请求之外,WLW 没有发出更多 HTTP 请求。

有什么线索我做错了什么吗?我已确保 wlwmanifest.xml 文件可用,事实上,任何对 wlwmanifest.xml 的请求(例如,/this/is/not/it/wlwmanifest.xml)仍将返回正确的结果文件。

编辑:我意识到我没有从 getUsersBlogs 方法返回数组。当我更改它时,方法调用的 HTTP 响应是:

.<?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>.

这看起来与 http://msdn.microsoft.com/en-us/library/aa905665.aspx 作为示例响应。但是,WLW 显示了错误 - “未将对象引用设置到对象的实例。”同样,实际的响应数据不包括句点 - 这就是网络监视器表示回车的方式。

我已经从测试工具完成了测试调用,并且它工作正常,响应相同。而且,正如我所说,它正在与其他博客客户端合作。帮助。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清风挽心 2024-08-19 01:47:24

WLW 似乎对 MWA 的实施非常挑剔。我没有正确地大写其中一个方法名称。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文