protected virtual void OnRequest(XmlRpcRequestEventArgs e)
 {
     if (RequestEvent != null)
     {
         RequestEvent(this, e);
     }
 }
示例#2
0
 protected override void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
   string fname = string.Format("{0}/{1}-{2:0000}-request-{3}.xml",
     _directory, DateTime.Now.Ticks, e.RequestNum, e.ProxyID);
   FileStream fstm = new FileStream(fname, FileMode.Create);
   Util.CopyStream(e.RequestStream, fstm);
   fstm.Close();
 }
示例#3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void OnRequest(object sender, XmlRpcRequestEventArgs e)
        {
            string fname = string.Format("{0}/{1}-{2:0000}-request-{3}.xml",
                                         _directory, DateTime.Now.Ticks, e.RequestNum, e.ProxyID);
            FileStream fstm = new FileStream(fname, FileMode.Create);

            Util.CopyStream(e.RequestStream, fstm);
            fstm.Close();
        }
 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));
 }
示例#5
0
 void proxy_RequestEvent(object sender, XmlRpcRequestEventArgs args)
 {
     if (RequestEvent != null) {
         TextReader txt = new StreamReader(args.RequestStream);
         string request = txt.ReadToEnd();
         RequestEvent(request);
     }
 }
示例#6
0
 protected virtual void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
 }
示例#7
0
 /// <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 ();
     }
 }
示例#8
0
 private void proxy_RequestEvent(object sender, XmlRpcRequestEventArgs args) {
     PrintStream(args.RequestStream);
 }
 // 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());
 }
示例#10
0
 private void LogRequest(object o, XmlRpcRequestEventArgs args)
 {
     LogSomething("Invoking XML-RPC method:", args.RequestStream);
 }
示例#11
0
 protected override void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
   DumpStream(e.RequestStream);
 }
示例#12
0
        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);
        }
示例#13
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
     DumpStream(e.RequestStream);
 }
示例#14
0
 protected virtual void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
 }
示例#15
0
 protected override void OnRequest(object sender,
     XmlRpcRequestEventArgs e)
 {
     base.OnRequest(sender, e);
       this.DumpStream(e.RequestStream);
 }
示例#16
0
 protected virtual void OnRequest(XmlRpcRequestEventArgs e)
 {
     RequestEvent?.Invoke(this, e);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnRequest(XmlRpcRequestEventArgs e)
 {
     if (RequestEvent != null)
     {
         RequestEvent(this, e);
     }
 }
示例#18
0
 private void myHandler(object sender, XmlRpcRequestEventArgs args)
 {
     long l = args.RequestStream.Length;
     args.RequestStream.Seek(0, System.IO.SeekOrigin.Begin);
     System.IO.StreamReader sr = new System.IO.StreamReader(args.RequestStream);
     lastRequest = sr.ReadToEnd();
 }