Beispiel #1
0
        public static void TestRequestXml()
        {
            XmlRpcRequest request = new XmlRpcRequest("version");

            request.AddParam(false);
            request.AddParam(3);
            request.AddParam(4.9);
            request.AddParam(DateTime.Now);
            request.AddParam(DateTime.UtcNow);
            request.AddParam(Encoding.UTF8.GetBytes("hello"));

            Dictionary <string, object> dictest = new Dictionary <string, object>();

            dictest.Add("hello", "hello");
            // request.AddParam(dictest);

            List <object> listtest = new List <object>();

            listtest.Add(3);
            listtest.Add("hello");
            listtest.Add(dictest);
            request.AddParam(listtest);

            XmlDocument xmlRequest = RequestFactory.BuildRequest(request);

            xmlRequest.Save(Console.Out);

            XmlRpcClient client = new XmlRpcClient();

            client.AppName = "Test";
            Console.WriteLine("\n");
            Console.WriteLine(client.GetUserAgent());
        }