简体   繁体   中英

Which is the best .Net XML-RPC library?

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!

If the method name is all that is changing (ie, 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.

前段时间使用过www.xml-rpc.net的图书馆取得了一些成功并且可以推荐它 - 它确实感觉设计和功能都很好。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM