示例#1
0
        public OpsiClient(string opsiServerRpcEndpoint, string username, string password, bool ignoreInvalidCert = false)
        {
            _opsiHttpClient = new OpsiHttpClient(opsiServerRpcEndpoint, username, password, ignoreInvalidCert);

            BackendInterface  = new BackendInterface(_opsiHttpClient);
            DepotInterface    = new DepotInterface(_opsiHttpClient);
            HostInterface     = new HostInterface(_opsiHttpClient);
            ProductsInterface = new ProductsInterface(_opsiHttpClient);
            BackendInterface  = new BackendInterface(_opsiHttpClient);
        }
示例#2
0
 /// <summary>
 /// Disconnect from the current server.
 /// </summary>
 public static void Disconnect()
 {
     if (Authenticated)
     {
         Logout();
     }
     if (ConnectedToServer)
     {
         Client            = (BackendInterface)XmlRpcProxyGen.Create(typeof(BackendInterface));
         Server            = "";
         ConnectedToServer = false;
     }
 }
示例#3
0
 /// <summary>
 /// Initiate the connection to the specified server.
 /// </summary>
 /// <param name="server"></param>
 public static void SetServer(string server)
 {
     if (!ConnectedToServer)
     {
         Client           = (BackendInterface)XmlRpcProxyGen.Create(typeof(BackendInterface));
         Client.KeepAlive = false;
         Client.Url       = server;
         if (Client.Ping() == "pong")
         {
             ConnectedToServer = true;
             Server            = server;
         }
         else
         {
             throw new Exception("An Error Occured While Connecting to the Server! Please check your connection and try again.");
         }
     }
     else
     {
         throw new Exception("Your already connected to a server! You must disconect from that server before you can connect to a new one!");
     }
 }
示例#4
0
 /// <summary>
 /// Disconnect from the current server.
 /// </summary>
 public static void Disconnect()
 {
     if (Authenticated)
     {
         Logout();
     }
     if (ConnectedToServer)
     {
         Client = (BackendInterface)XmlRpcProxyGen.Create(typeof(BackendInterface));
         Server = "";
         ConnectedToServer = false;
     }
 }
示例#5
0
 /// <summary>
 /// Initiate the connection to the specified server.
 /// </summary>
 /// <param name="server"></param>
 public static void SetServer(string server)
 {
     if (!ConnectedToServer)
     {
         Client = (BackendInterface)XmlRpcProxyGen.Create(typeof(BackendInterface));
         Client.KeepAlive = false;
         Client.Url = server;
         if (Client.Ping() == "pong")
         {
             ConnectedToServer = true;
             Server = server;
         }
         else
         {
             throw new Exception("An Error Occured While Connecting to the Server! Please check your connection and try again.");
         }
     }
     else
     {
         throw new Exception("Your already connected to a server! You must disconect from that server before you can connect to a new one!");
     }
 }