Exemplo n.º 1
0
        /// <summary>
        /// Constructor for initialization 
        /// </summary>
        public RestAPI()
        {
            // Logger.LogWrite(EskimoDBLogLevel.Verbose, "Creating");
            DependencyInjection di = DependencyInjection.GetInstance();

            mockRootServer = (IRootServer)di.CreateObject("root", new object[]{
                this,new WSDualHttpBinding(),"http://localhost:8080/root"});
            mockAuthServer = (IAuthServer)di.CreateObject("auth", new object[]{
                null,new BasicHttpBinding(),"http://149.119.196.45:8080/IComm"});

            m_PutDataSetCalled = false;
            m_PutQueryInfoCalled = false;
            m_QueryResult = new QueryResult(0, null, null);
            m_id = null;
            m_QueryDataset = new QueryDataset(new System.Collections.Generic.List<Type>(), new System.Collections.Generic.List<string>());
            m_lines = 0;

            m_IterateToTheEnd = 0;
            m_CallGetResult = true;
            m_startLine = 0;
            m_RowsPerTime = 5;
            m_IterateIndex = 0;
            m_FinalLines = 0;
            m_Table = new Tables();

        }
Exemplo n.º 2
0
 bool Release(IRootServer svc)
 {
   string id = "demoID", token = "demo auth token";
   QueryResult queryResult = svc.Release(id, token);
   if (queryResult != null)
     return true;
   return false;
 }
Exemplo n.º 3
0
 bool ExecQuery(IRootServer svc)
 {
   string query = "create db dbname;", token = "demo auth token";
   QueryResult queryResult = svc.ExecQuery(query, token);
   if (queryResult != null)
     return true;
   return false;
 }
Exemplo n.º 4
0
 bool getResult(IRootServer svc)
 {
   string id = "demoID", token = "demo auth token";
   int startLine = 1, numberOfLines = 10;
   QueryResult queryResult = svc.GetResult(id, startLine, numberOfLines, token);
   if (queryResult != null)
     return true;
   return false;
 }
Exemplo n.º 5
0
        private bool Connect(String host)
        {
            Console.WriteLine("Connecting to PractiSES root server ({0})...", host);
            rootServer = (IRootServer)Activator.GetObject(typeof(IRootServer), "http://" + host + ":88/PractiSES_Root");
            try
            {
                if (rootServer.Hello())
                {
                    Console.WriteLine("Connected to PractiSES root server.");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Unable to connect to PractiSES root server.");
                return(false);
            }

            /*Console.Write("Domain Name: ");
             * String domainName = Console.ReadLine();
             * GetCertificate(domainName);*/

            return(true);
        }
Exemplo n.º 6
0
        /*private X509Certificate2 GetCertificate(String domainName)
         * {
         *  return rootServer.GetCertificate(domainName);
         * }*/

        private bool ConnectRootServer(String host)
        {
            ActionLog_Write("Connecting to PractiSES root server (" + host + ")...");
            Console.WriteLine("Connecting to PractiSES root server ({0})...", host);

            rootServer = (IRootServer)Activator.GetObject(typeof(IRootServer), "http://" + host + ":88/PractiSES_Root");

            try
            {
                if (rootServer.Hello())
                {
                    ActionLog_Write("Connected to PractiSES root server..");
                    Console.WriteLine("Connected to PractiSES root server.");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message + "\nUnable to connect to PractiSES root server.");
                return(false);
            }

            return(true);
        }
Exemplo n.º 7
0
    /// <summary>
    /// Configuring the client api by creating objects using the dependency framework
    /// </summary>
    public void ConfigClient()
    {
      Logger.LogWrite("Creating instance of DI to cinfigure client api");
      di = DependencyInjection.GetInstance();
      mockRootServer = (IRootServer)di.CreateObject("root", new object[]{
                this,new WSDualHttpBinding(),rootHostAddress});
      mockAuthServer = (IAuthServer)di.CreateObject("auth", new object[]{
                null,new BasicHttpBinding(),authHostAddress});

    }
Exemplo n.º 8
0
        private bool Connect(String host)
        {
            Console.WriteLine("Connecting to PractiSES root server ({0})...", host);
            rootServer = (IRootServer)Activator.GetObject(typeof(IRootServer), "http://" + host + ":88/PractiSES_Root");
            try
            {
                if (rootServer.Hello())
                {
                    Console.WriteLine("Connected to PractiSES root server.");
                }
            }
            catch(Exception e)
            {
                Console.WriteLine("Unable to connect to PractiSES root server.");
                return false;
            }

            /*Console.Write("Domain Name: ");
            String domainName = Console.ReadLine();
            GetCertificate(domainName);*/

            return true;
        }
Exemplo n.º 9
0
        /*private X509Certificate2 GetCertificate(String domainName)
        {
            return rootServer.GetCertificate(domainName);
        }*/
        private bool ConnectRootServer(String host)
        {
            ActionLog_Write("Connecting to PractiSES root server (" + host + ")...");
            Console.WriteLine("Connecting to PractiSES root server ({0})...", host);

            rootServer = (IRootServer)Activator.GetObject(typeof(IRootServer), "http://" + host + ":88/PractiSES_Root");

            try
            {
                if (rootServer.Hello())
                {
                    ActionLog_Write("Connected to PractiSES root server..");
                    Console.WriteLine("Connected to PractiSES root server.");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message + "\nUnable to connect to PractiSES root server.");
                return false;
            }

            return true;
        }