Beispiel #1
0
 private ExportImport.ConversionClientLib.Proxy CreateProxy(string url, int timeout)
 {
     ExportImport.ConversionClientLib.Proxy proxy = XmlRpcProxyGen.Create <ExportImport.ConversionClientLib.Proxy>();
     proxy.Url            = url;
     proxy.NonStandard    = XmlRpcNonStandard.All;
     proxy.Timeout        = timeout;
     proxy.UseIndentation = false;
     proxy.UserAgent      = UserAgent;
     proxy.KeepAlive      = true;
     return(proxy);
 }
Beispiel #2
0
        public void Connect(ServerInfo hostInfo)
        {
            if (((hostInfo.Hostname.Length == 0) || (hostInfo.Username.Length == 0)) || (hostInfo.Password.Length == 0))
            {
                throw new ArgumentException("Host info is empty");
            }
            Dictionary <string, string> xenServerVersionInfo = this.GetXenServerVersionInfo(hostInfo);

            if ((xenServerVersionInfo != null) && (xenServerVersionInfo.Count == 3))
            {
                IsTampaOrGreater(xenServerVersionInfo);
            }
            this.m_hostInfo   = hostInfo;
            this.m_serviceUrl = GetServiceUrl(hostInfo);
            LOG.Info(string.Format("Conversion info: service={0}", this.m_serviceUrl));
            this.m_proxy = this.CreateProxy(this.m_serviceUrl, this.m_requestRegularTimeout);
            ServiceCred cred = new ServiceCred(this.m_hostInfo.Username, this.m_hostInfo.Password);
            string      msg  = string.Format("ConversionClient version={0}, Application version={1}", Assembly.GetExecutingAssembly().GetName().Version.ToString(), Assembly.GetCallingAssembly().GetName().Version.ToString());

            this.m_proxy.LogMessage(cred, 6, msg);
        }