static void Main(string[] args)
{
if (args.Length < 4)
{
Console.WriteLine("Usage: PanelApiRpcClient <Hostname> <Login> <Password> <Request>");
Console.WriteLine(" ");
Console.WriteLine(" Hostname - Panel host name");
Console.WriteLine(" Login - Administrator's login");
Console.WriteLine(" Password - Administrator's password");
Console.WriteLine(" Request - Request file path (*.xml)");
return;
}
ServicePointManager.ServerCertificateValidationCallback =
new RemoteCertificateValidationCallback(RemoteCertificateValidation);
Request request = new Request();
request.Hostname = args[0];
request.Login = args[1];
request.Password = args[2];
string packet = args[3];
try
{
XmlDocument result = request.Send(packet);
PrintResult(result);
}
catch (Exception e)
{
Console.WriteLine("Request error: {0}", e.Message);
}
}