ApiRpcExample.Request.Send C# (CSharp) 메소드

Send() 공개 메소드

public Send ( Stream packet ) : XmlDocument
packet Stream
리턴 System.Xml.XmlDocument
        public XmlDocument Send(Stream packet)
        {
            using (TextReader reader = new StreamReader(packet))
            {
                return Send(Parse(reader));
            }
        }

Same methods

Request::Send ( XmlDocument packet ) : XmlDocument
Request::Send ( string packetUri ) : XmlDocument

Usage Example

예제 #1
0
        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);
            }
        }