1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
[XmlRpcUrl("https://moodle:443/api/xmlrpc")] public interface iFace : IXmlRpcProxy { [XmlRpcMethod("get_users")] XmlRpcStruct[] Get_users_by_id(string key, string userid, string[] returnFields); } public class Program { public static void Main(string[] args) { iFace proxy = XmlRpcProxyGen.Create<iFace>(); XmlRpcStruct[] users = proxy.findByEmail("apiKey", "admin@localhost", new[] { "Id", "FirstName", "LastName" }); foreach(XmlRpcStruct user in users) { Console.Write("Id: " + user["Id"]); Console.Write("First Name: " + user["FirstName"]); Console.WriteLine(); } } } |