Exemple #1
0
 public Talker(Settings settings)
 {
     // connect to Backend
     this.settings = settings;
     this.session = new Session(
         settings["backend_server"],
         Convert.ToInt32( settings["backend_port"] ),
         settings["backend_auth_user"],
         settings["backend_auth_pass"],
         settings["account_address"]
         );
 }
Exemple #2
0
 public void test_3()
 {
     Session bs = new Session("127.0.0.1", 8080, USER, "emex", "emex");
     Command cmd = new Command(bs);
     //Result bres = cmd.GetContacts();
     //if (0 == bres.code)
     //{
     //    Hashtable h2 = (Hashtable)bres.return_[0];
     //    //System.Diagnostics.Debug.WriteLine(
     //}
     //Console.WriteLine(bres.desc);
 }
Exemple #3
0
        public void test_1()
        {
            Session bs = new Session("127.0.0.1", 8080, USER, "emex", "emex" );
            Hashtable h = new Hashtable();
            h["email"] = "deyan.imap@localhost";
            h["word"] = "message";
            //string url = "http://*****:*****@localhost&word=message";
            string str = bs.request(Session.RequestType.RT_GET, "search_email", h);
            //Console.WriteLine(str);

            Result bres = bs.JSON2Result(str);
            if (0 == bres.code)
            {
                Hashtable h2 = (Hashtable)bres.return_[0];
                Console.WriteLine(Convert.ToUInt32(h2["id"]));
                Console.WriteLine(Convert.ToString(h2["data"]));

            }
            Console.WriteLine(bres.desc);
        }
Exemple #4
0
        public void test_2()
        {
            // SEND MAIL

            Session bs = new Session("127.0.0.1", 8080, USER, "emex", "emex");
            Hashtable h = new Hashtable();
            h["email"] = "deyan.imap@localhost";
            h["to"] = "ppetrov@localhost";
            h["subject"] = "TEST MAIL VIA Post methods";
            h["body"] = "Log4php is logging framework for PHP undergoing incubation at the Apache Software Foundation (ASF), sponsored by the Apache Logging Services project. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.";
            string str = bs.request(Session.RequestType.RT_POST, "send_email", h);
            Result bres = bs.JSON2Result(str);
            if (0 == bres.code)
            {
                //Hashtable h2 = (Hashtable)bres.return_[0];
                //Console.WriteLine(Convert.ToUInt32(h2["id"]));
                //Console.WriteLine(Convert.ToString(h2["data"]));

            }
            Console.WriteLine(bres.desc);
        }
Exemple #5
0
 public Command(Session session)
 {
     this.session = session;
 }