コード例 #1
0
ファイル: Session.cs プロジェクト: ywwseu/xenadmin
        private void LogRequest(object o, XmlRpcRequestEventArgs args)
        {
            string xml = DumpStream(args.RequestStream, String.Empty);

            // Find the method name within the XML
            string methodName      = "";
            int    methodNameStart = xml.IndexOf("<methodName>");

            if (methodNameStart >= 0)
            {
                methodNameStart += 12; // skip past "<methodName>"
                int methodNameEnd = xml.IndexOf('<', methodNameStart);
                if (methodNameEnd > methodNameStart)
                {
                    methodName = xml.Substring(methodNameStart, methodNameEnd - methodNameStart);
                }
            }

            // do not log while downloading objects
            // also exclude calls occurring frequently; we don't need to know about them;
            // only log the full XML at Debug level because it may have sensitive data in: CA-80174

            if (CanLogCall(methodName))
            {
                log.DebugFormat("Invoking XML-RPC method {0}: {1}", methodName, xml);
            }
            else
            {
                log.InfoFormat("Invoking XML-RPC method {0}", methodName);
            }
        }
コード例 #2
0
 private void LoginRequest(object sender, XmlRpcRequestEventArgs e)
 {
     if (OnLoginResponse != null)
     {
         OnLoginResponse(e.m_Request, e.m_originalSize, e.m_headers, e.m_host, Direction.Outgoing);
     }
 }
コード例 #3
0
        void proxy_RequestEvent(object sender, XmlRpcRequestEventArgs args)
        {
            Console.Clear();
            // Set the position to the beginning of the stream.
            Stream memStream = args.RequestStream;

            memStream.Seek(0, SeekOrigin.Begin);
            // Read the first 20 bytes from the stream.
            byte[] byteArray = new byte[memStream.Length];
            int    count     = memStream.Read(byteArray, 0, 20);

            // Read the remaining bytes, byte by byte.
            while (count < memStream.Length)
            {
                byteArray[count++] = Convert.ToByte(memStream.ReadByte());
            }
            // Decode the byte array into a char array
            // and write it to the console.
            //UnicodeEncoding uniEncoding = new UnicodeEncoding();
            //char[]charArray = new char[uniEncoding.GetCharCount(byteArray, 0, count)];
            //uniEncoding.GetDecoder().GetChars(byteArray, 0, count, charArray, 0);
            ASCIIEncoding ascii = new ASCIIEncoding();

            Console.WriteLine(ascii.GetString(byteArray));
        }
コード例 #4
0
 // LoginRequest: dump a login request to the console
 private void LoginRequest(object sender, XmlRpcRequestEventArgs e)
 {
     if (logLogin)
     {
         Console.WriteLine("==> Login Request");
         Console.WriteLine(e.m_Request);
     }
 }
コード例 #5
0
ファイル: Server.cs プロジェクト: skydiverman/bugziller
 /// <summary>Called when a request is made</summary>
 /// <param name="sender">The <c>XmlRpcClientProtocol</c> from the XML-RPC
 /// library, who raised this event.</param>
 /// <param name="e">The Event arguments</param>
 protected override void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
     if (Writer != null)
     {
         Writer.WriteLine("Sending =====>");
     }
     DumpStream(e.RequestStream);
     if (Writer != null)
     {
         Writer.WriteLine("=====");
         Writer.Flush();
     }
 }
コード例 #6
0
ファイル: Session.cs プロジェクト: wuzhiwyyx/xenadmin
        private void LogRequest(object o, XmlRpcRequestEventArgs args)
        {
            Level  logLevel;
            string xml = DumpStream(args.RequestStream, String.Empty);

            // Find the method name within the XML
            string methodName      = "";
            int    methodNameStart = xml.IndexOf("<methodName>");

            if (methodNameStart >= 0)
            {
                methodNameStart += 12;  // skip past "<methodName>"
                int methodNameEnd = xml.IndexOf('<', methodNameStart);
                if (methodNameEnd > methodNameStart)
                {
                    methodName = xml.Substring(methodNameStart, methodNameEnd - methodNameStart);
                }
            }

            if (CacheWarming)
            {
                logLevel = Level.Debug;
            }
            else if (methodName == "event.next" || methodName == "event.from" || methodName == "host.get_servertime" || methodName.StartsWith("task.get_"))  // these occur frequently and we don't need to know about them
            {
                logLevel = Level.Debug;
            }
            else
            {
                logLevel = Level.Info;
            }

            // Only log the full XML at Debug level because it may have sensitive data in: CA-80174
            if (logLevel == Level.Debug)
            {
                LogMsg(logLevel, "Invoking XML-RPC method " + methodName + ": " + xml);
            }
            else
            {
                LogMsg(logLevel, "Invoking XML-RPC method " + methodName);
            }
        }
コード例 #7
0
ファイル: Tracer.cs プロジェクト: cuilishen/MediaPoint
 protected override void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
     this.DumpStream(e.RequestStream);
 }
コード例 #8
0
 private void svc_RequestEvent(object sender, XmlRpcRequestEventArgs args)
 {
     PrintStream(args.RequestStream);
 }
コード例 #9
0
 protected override void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
     _listener.OnRequest(DumpStream(e.RequestStream));
 }
コード例 #10
0
 private void LogRequest(object o, XmlRpcRequestEventArgs args)
 {
     LogSomething("Invoking XML-RPC method:", args.RequestStream);
 }
コード例 #11
0
 // LoginRequest: tell the user about login process starting
 private void MyLoginRequest(object sender, XmlRpcRequestEventArgs request)
 {
     SayToUser("Sending login request to server.");
     StatusSetMsg("Logging in...");
 }
コード例 #12
0
 protected override void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
     DumpStream(e.RequestStream);
 }
コード例 #13
0
ファイル: Utils.cs プロジェクト: giuseppecristella/MaWeb
        // utility for xml-rpc request handler
        public static void RequestEventHandler(object sender, XmlRpcRequestEventArgs args)
        {
            StreamReader reader = new StreamReader(args.RequestStream, Encoding.UTF8);

            Console.WriteLine("\nXML-RPC REQUEST\n" + reader.ReadToEnd());
        }