tags:

views:

552

answers:

3

I need to communicate with an XML-RPC server from a .NET 2.0 client. Can you recommend any libraries?

EDIT: Having tried XML-RPC.Net, I like the way it generates dynamic proxies, it is very neat. Unfortunately, as always, things are not so simple. I am accessing an XML-RPC service which uses the unorthodox technique of having object names in the names of the methods, like so:

object1.object2.someMethod(string1)

This means I can't use the attributes to set the names of my methods, as they are not known until run-time. If you start trying to get closer to the raw calls, XML-RPC.Net starts to get pretty messy.

So, anyone know of a simple and straightforward XML-RPC library that'll just let me do (pseudocode):

x = new xmlrpc(host, port)
x.makeCall("methodName", "arg1");

I had a look at a thing by Michael somebody on Codeproject, but there are no unit tests and the code looks pretty dire.

Unless someone has a better idea looks like I am going to have to start an open source project myself!

+2  A: 

I've used the library from www.xml-rpc.net some time ago with some success and can recommend it -- it did feel well designed and functional.

Matthias Kestenholz
+2  A: 

If the method name is all that is changing (i.e., the method signature is static) XML-RPC.NET can handle this for you. This is addressed in the FAQ, noting "However, there are some XML-RPC APIs which require the method name to be generated dynamically at runtime..." From the FAQ:

ISumAndDiff proxy = (ISumAndDiff)XmlRpcProxyGen.Create(typeof(ISumAndDiff));
proxy.XmlRpcMethod = "Id1234_SumAndDifference"
proxy.SumAndDifference(3, 4);

This generates an XmlRpcProxy which implementes the specified interface. Setting the XmlRpcMethod attribute causes methodCalls to use the new method name.

Troy J. Farrell
A: 

I had also tried to run www.xml-rpc.net with Mono on Windows XP and it worked in Mono .NET Runtime also properly. Just for information for everybody.

Shailesh Kumar