how to use XMLRPC in C#
Asked Answered
A

2

17

I need to make XMLRPC calls from my C# application and I failed to find any help with that. When I used XMLRPC from Ruby, it's that simple:

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

is there any similar library for C#?

Aberdare answered 28/8, 2009 at 17:56 Comment(0)
A
22

It's very simple to use the xml-rpc.net library, here is what you need to do:

[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");
Aberdare answered 28/8, 2009 at 20:0 Comment(1)
I have only one nitpick with xml-rpc.net: it doesn't support optional parameters.Tragopan
A
21

See if this library works for you
https://code.google.com/p/xmlrpcnet/

Atelectasis answered 28/8, 2009 at 18:1 Comment(2)
The problem with this library is that its quite dated and isn't compatible with either Windows Store or Phone apps and doesn't support async as well. There aren't any alternatives I know of at this time.Ostrich
This library is open source, and is readily available (code.google.com/p/xmlrpcnet/source/checkout). I'm sure you could fork it and port it to these newer and more recent platforms :)Atelectasis

© 2022 - 2024 — McMap. All rights reserved.