简体   繁体   English

哪个是最好的.Net XML-RPC库?

[英]Which is the best .Net XML-RPC library?

I need to communicate with an XML-RPC server from a .NET 2.0 client. 我需要从.NET 2.0客户端与XML-RPC服务器进行通信。 Can you recommend any libraries? 你能推荐任何图书馆吗?

EDIT: Having tried XML-RPC.Net, I like the way it generates dynamic proxies, it is very neat. 编辑:尝试过XML-RPC.Net后,我喜欢它生成动态代理的方式,它非常简洁。 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: 我正在访问XML-RPC服务,该服务使用非常规技术在方法名称中包含对象名称,如下所示:

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. 如果你开始尝试接近原始调用,XML-RPC.Net开始变得非常混乱。

So, anyone know of a simple and straightforward XML-RPC library that'll just let me do (pseudocode): 所以,任何人都知道一个简单直接的XML-RPC库,它只会让我做(伪代码):

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. 我在Codeproject上看过迈克尔某个人的事情,但是没有单元测试,代码看起来很可怕。

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. 如果方法名称正在改变(即方法签名是静态的),XML-RPC.NET可以为您处理。 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: 在FAQ中解决,注意“但是,有一些XML-RPC API需要在运行时动态生成方法名称......”来自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. 这将生成一个XmlRpcProxy,用于实现指定的接口。 Setting the XmlRpcMethod attribute causes methodCalls to use the new method name. 设置XmlRpcMethod属性会导致methodCalls使用新方法名称。

前段时间使用过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. 我还尝试在Windows XP上使用Mono运行www.xml-rpc.net ,它也适用于Mono .NET Runtime。 Just for information for everybody. 只是为了每个人的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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