gpt4 book ai didi

c# - 如何在 C# 中使用 XMLRPC

转载 作者:可可西里 更新时间:2023-11-01 03:04:27 24 4
gpt4 key购买 nike

我需要从我的 C# 应用程序进行 XMLRPC 调用,但我没有找到任何帮助。当我从 Ruby 使用 XMLRPC 时,就这么简单:

server = XMLRPC::Client.new2("http://server/api.php")
result = server.call("remote.procedure", [1, [['crit1', 'crit2', 'crit3']]])

有没有类似的 C# 库?

最佳答案

使用 xml-rpc.net 库非常简单,以下是您需要做的:

[XmlRpcUrl("http://url_to_your_server/api.php")]
public interface ISumAndDiff : IXmlRpcProxy
{
[XmlRpcMethod("your.remote.procedure")]
string testMyClient(string test);
}

ISumAndDiff proxy = XmlRpcProxyGen.Create<ISumAndDiff>();

string ret = proxy.testMyClient("test");

关于c# - 如何在 C# 中使用 XMLRPC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1348503/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com