views:

1616

answers:

5

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?

+1  A: 

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.

eczarny
The "XML-RPC for C and C++" library does not work on Windows - I quote: "...but the fact is that it probably won't work out-of-the-box on your Windows system."That means that there's only one library for C++ that runs on Windows, i.e. Chris Morley's, and it doesn't have SSL support.
Tim Cooper
+2  A: 

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.

Tim Cooper
+1  A: 

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

Chris Morley
+1  A: 

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:

  • The Windows "wininet.lib" library gives you all the functionality for handling Http requests, so I'd rather use that. As a result, I only needed 1700 LOC.
  • "wininet.lib", and therefore my implementation, supports HTTPS
  • Chris Morley's use of STL containers was quite inefficient (Chris, mail me if you read this).
Tim Cooper
Roel
Those are gone now.
Tim Cooper
Small update, I've been using this library with great success and it was very easy to implement. Highly recommended for anyone needing XmlRpc on Windows.
Roel
A: 

I am trying to use xmlrpcc4win library and I'm have a couple of issues understanding its operations. Wish there were some documentation.... I can retrieve ints and strings from my server, but don't know how to retrieve the array of structures containing dictionary pairs as ASCII strings. What functions do I call to retrieve the data? Using Perl with the Frontier module I have valid data, but I need to do this project with Visual Studio 2008 in C++.

Any help would be appreciated.

Thanks.

Larry McDonald
I've created some (more?) documentation in v1.0.8 by expanding the "SampleMain.cpp" file to have some examples of setting and retrieving each type of value. This includes an example of retrieving a struct of arrays...an array of structs should be quite straightforward. It's best to email me directly via SourceForge for rapid support.
Tim Cooper