Ejemplo n.º 1
0
 protected virtual void OnRequest(XmlRpcRequestEventArgs e)
 {
     if (RequestEvent != null)
     {
         RequestEvent(this, e);
     }
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 4
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));
 }
Ejemplo n.º 5
0
 void proxy_RequestEvent(object sender, XmlRpcRequestEventArgs args)
 {
     if (RequestEvent != null) {
         TextReader txt = new StreamReader(args.RequestStream);
         string request = txt.ReadToEnd();
         RequestEvent(request);
     }
 }
Ejemplo n.º 6
0
 protected virtual void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
 }
Ejemplo n.º 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 ();
     }
 }
Ejemplo n.º 8
0
 private void proxy_RequestEvent(object sender, XmlRpcRequestEventArgs args) {
     PrintStream(args.RequestStream);
 }
Ejemplo n.º 9
0
 // 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());
 }
Ejemplo n.º 10
0
 private void LogRequest(object o, XmlRpcRequestEventArgs args)
 {
     LogSomething("Invoking XML-RPC method:", args.RequestStream);
 }
Ejemplo n.º 11
0
 protected override void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
   DumpStream(e.RequestStream);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 13
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
     DumpStream(e.RequestStream);
 }
Ejemplo n.º 14
0
 protected virtual void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
 }
Ejemplo n.º 15
0
 protected override void OnRequest(object sender,
     XmlRpcRequestEventArgs e)
 {
     base.OnRequest(sender, e);
       this.DumpStream(e.RequestStream);
 }
Ejemplo n.º 16
0
 protected virtual void OnRequest(XmlRpcRequestEventArgs e)
 {
     RequestEvent?.Invoke(this, e);
 }
Ejemplo n.º 17
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnRequest(XmlRpcRequestEventArgs e)
 {
     if (RequestEvent != null)
     {
         RequestEvent(this, e);
     }
 }
Ejemplo n.º 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();
 }