Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is the best .Net XML-RPC library?

Tags:

.net

xml-rpc

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!

like image 882
Matt Howells Avatar asked Sep 19 '08 11:09

Matt Howells


1 Answers

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.

like image 148
Troy J. Farrell Avatar answered Sep 17 '22 14:09

Troy J. Farrell