在 C++ 中使用 XmlRpc 和窗户
我需要在 Windows 平台上使用 C++ 中的 XmlRpc。 尽管我的朋友向我保证 XmlRpc 是一种“广泛可用的标准技术”,但可用的库并不多。 事实上,我只找到一个库可以在 Windows 上执行此操作(另外一个库声称“您必须做很多工作才能在 Windows 上编译它)。我找到的库是 Chris Morley 的“XmlRpc++”。但是,它不支持 SSL,
因此我的问题是:我应该使用什么库?
I need to use XmlRpc in C++ on a Windows platform. Despite the fact that my friends assure me that XmlRpc is a "widely available standard technology", there are not many libraries available for it. In fact I only found one library to do this on Windows, (plus another one that claims "you'll have to do a lot of work to get this to compile on Windows). The library I found was Chris Morley's "XmlRpc++". However, it doesn't have support for SSL.
My question therefore is: what library should I be using?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
XML-RPC 实现有数十种,其中一些是用 C++ 编写的,但大多数是用 C++ 编写的在其他语言中。 例如,除了 XmlRpc++ 之外,还有 用于 C 和 C++ 的 XML-RPC。 这是关于 XML-RPC 如何使用的 HOWTO可以使用 C 和 C++ 库。
XML-RPC 规范有些简单,实现您自己的 XML-RPC 客户端并不困难。 更不用说,还可以采用 C 语言中的现有 XML-RPC 实现并将其引入您的 C++ 项目中。
XML-RPC 主页还提供了大量有用的信息。
There are dozens of implementations of the XML-RPC implementations, some in C++, but most in other languages. For example, besides XmlRpc++ there is also XML-RPC for C and C++. Here is a HOWTO on how the XML-RPC for C and C++ library can be used.
The XML-RPC specification is somewhat simple and it would not be difficult to implement your own XML-RPC client. Not to mention, it would also be possible to take an existing XML-RPC implementation in C and bring into your C++ project.
The XML-RPC home page also provides a lot of useful information.
只是想注意几项:
XmlRpc++ 的 cvs 存储库中的源代码支持 OpenSSL(虽然我没有尝试过,它是由另一位开发人员贡献的)。
大多数报告的错误已在 cvs 中修复; 我目前无法访问linux机器,所以还没有发布正式版本。
XmlRpc++ 不是公共领域。 它受版权保护并获得许可 (LGPL)。
谢谢,
克里斯·莫利
Just wanted to note a couple of items:
The source in the cvs repository for XmlRpc++ has support for OpenSSL (although I have not tried it, it was contributed by another developer).
Most of the reported bugs are fixed in cvs; I don't have access to a linux machine at the moment, so I haven't made an official release.
XmlRpc++ is not public domain. It is copyrighted and licensed (LGPL).
Thanks,
Chris Morley
我能够让 Tim 的 xml rpc 版本与 https 一起使用并使用基本的用户名/密码身份验证。
对于身份验证:
1) 需要将用户名和密码传递给 InternetConnect(...) 函数
2) 在发送 HttpSendRequest 之前需要添加“Authorization: Basic base64encoded(user:pass)”的 http 请求标头(...) 命令。
I was able to get Tim's version of xml rpc working with https and with basic username / password authentication.
For the authentication:
1) the username and password need to be passed to the InternetConnect(...) function
2) an http request header of "Authorization: Basic base64encoded(user:pass)" needs to be added prior to sending the HttpSendRequest(...) command.
我已经编写了自己的 C++ 库。 它可以在 sourceforge 上找到:
xmlrpcc4win
我编写它而不是使用 Chris Morley 的原因是:
I've written my own C++ library. It's available at sourceforge:
xmlrpcc4win
The reason I wrote it rather than using Chris Morley's was that:
在我编写自己的库之前,(见上文)这是我的答案:
目前,Chris 的 XmlRpc++ 库 Morley 是 Windows 上 C++ 的唯一公共域/LPGL XmlRpc 实现。
Linux 有几个 C++ 实现,其中任何一个都可以很容易地移植到 Windows,但事实似乎是还没有人这样做并将其公开可用。 另外,正如 eczamy 所说,“XML-RPC 规范有些简单,实现您自己的 XML-RPC 客户端并不困难。”
尽管必须找到并修复相当多的错误,但我正在成功使用 Chris Morley 的库。 这个项目的帮助论坛似乎有点活跃,但没有人修复这些错误并发布新版本。 我一直在与 Chris Morley 通信,他模糊地希望发布一个新版本,他对这个 stackOverflow 问题做出了贡献(见下文/上文),他声称已经修复了大部分错误,但到目前为止他还没有发布了一个修复了许多错误的版本。 最后一次发布是在 2003 年。
令我失望的是,一个被认为得到广泛支持(而且简单!)的协议在 Windows + C++ 上的支持却如此糟糕。 请阅读此页的人拿起接力棒,例如接管 XmlRpc++ 或正确移植 Linux 实现之一。
Until I wrote my own library, (see above) here was my answer:
Currently, the XmlRpc++ library by Chris Morley is the only public domain/LPGL XmlRpc implementation for C++ on Windows.
There are a couple of C++ implementations for Linux, either of which could be presumably easily ported to Windows, but the fact seems to be that no-one has yet done so and made it publicly available. Also, as eczamy says, "The XML-RPC specification is somewhat simple and it would not be difficult to implement your own XML-RPC client."
I'm using Chris Morley's library successfully, despite having had to find and fix quite a number of bugs. The Help Forum for this project seems to be somewhat active, but no-one has fixed these bugs and done a new release. I have been in correspondence with Chris Morley and he has vague hopes to do a new release, and he has contributed to this stackOverflow question (see below/above) and he claims to have fixed most of the bugs, but so far he has not made a release that fixes the many bugs. The last release was in 2003.
It is disappointing to me that a supposed widely supported (and simple!) protocol has such poor support on Windows + C++. Please can someone reading this page pick up the baton and e.g. take over XmlRpc++ or properly port one of the Linux implementations.