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

发布于 2024-07-04 17:26:36 字数 564 浏览 7 评论 0 原文

我需要从 .NET 2.0 客户端与 XML-RPC 服务器进行通信。 你能推荐一些图书馆吗?

编辑:尝试过 XML-RPC.Net,我喜欢它生成动态代理的方式,它非常简洁。 不幸的是,一如既往,事情并不那么简单。 我正在访问一个 XML-RPC 服务,该服务使用非正统的技术,在方法的名称中包含对象名称,如下所示:

object1.object2.someMethod(string1)

这意味着我无法使用属性来设置方法的名称,因为它们直到运行。 如果您开始尝试更接近原始调用,XML-RPC.Net 就会开始变得相当混乱。

所以,任何人都知道一个简单明了的 XML-RPC 库,它就可以让我做(伪代码):

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

我在 Codeproject 上看过 Michael 某人的一个东西,但没有单元测试,而且代码看起来非常糟糕。

除非有人有更好的主意,否则我将不得不自己启动一个开源项目!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

心的憧憬 2024-07-11 17:26:36

我还尝试使用 www.xml-rpc.net //www.mono-project.com/Main_Page" rel="nofollow noreferrer">Mono 在 Windows XP 上,它在 Mono .NET Runtime 中也能正常工作。 仅供大家参考。

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.

盗梦空间 2024-07-11 17:26:36

我不久前使用过 www.xml-rpc.net 中的库并取得了一些成功,可以推荐它——它确实设计得很好,而且功能齐全。

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.

拧巴小姐 2024-07-11 17:26:36

如果改变的只是方法名称(即方法签名是静态的),XML-RPC.NET 可以为您处理这个问题。 常见问题解答对此进行了解决,并指出“但是,有一些 XML-需要在运行时动态生成方法名称的 RPC API...”来自常见问题解答:

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

这会生成实现指定接口的 XmlRpcProxy。 设置 XmlRpcMethod 属性会导致 methodCalls 使用新方法名称。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文