Ejemplo n.º 1
0
        //public static void GetIWCFDownloadManagerService()
        //{
        //    //if (_rs.Data.ContainsKey("Service_ChannelFactory") && _rs.Data.ContainsKey("Service_IWCFDownloadManager"))
        //    //{
        //    //    _channelFactory = (ChannelFactory<IWCFDownloadManager>)_rs.Data["Service_ChannelFactory"];
        //    //    _service = (IWCFDownloadManager)_rs.Data["Service_IWCFDownloadManager"];
        //    //}
        //    Trace.WriteLine("create client service WCFDownloadManager");
        //    string address = "http://localhost:8019/WCFDownloadManager";
        //    ContractDescription contractDescription = ContractDescription.GetContract(typeof(IWCFDownloadManager));
        //    WSHttpBinding binding = new WSHttpBinding();
        //    EndpointAddress endpointAddress = new EndpointAddress(new Uri(address));
        //    ServiceEndpoint endpoint = new ServiceEndpoint(contractDescription, binding, endpointAddress);
        //    _channelFactory = new ChannelFactory<IWCFDownloadManager>(endpoint);
        //    _service = _channelFactory.CreateChannel();
        //}

        public static void CreateDownloadManagerClient()
        {
            if (__downloadManager == null)
            {
                __downloadManager = new DownloadManagerClient(XmlConfig.CurrentConfig.Get("DownloadAutomateManager/DownloadManager/Address"));
            }
        }
Ejemplo n.º 2
0
        //public static void GetIWCFDownloadManagerService()
        //{
        //    //if (_rs.Data.ContainsKey("Service_ChannelFactory") && _rs.Data.ContainsKey("Service_IWCFDownloadManager"))
        //    //{
        //    //    _channelFactory = (ChannelFactory<IWCFDownloadManager>)_rs.Data["Service_ChannelFactory"];
        //    //    _service = (IWCFDownloadManager)_rs.Data["Service_IWCFDownloadManager"];
        //    //}
        //    Trace.WriteLine("create client service WCFDownloadManager");
        //    string address = "http://localhost:8019/WCFDownloadManager";
        //    ContractDescription contractDescription = ContractDescription.GetContract(typeof(IWCFDownloadManager));
        //    WSHttpBinding binding = new WSHttpBinding();
        //    EndpointAddress endpointAddress = new EndpointAddress(new Uri(address));
        //    ServiceEndpoint endpoint = new ServiceEndpoint(contractDescription, binding, endpointAddress);
        //    _channelFactory = new ChannelFactory<IWCFDownloadManager>(endpoint);
        //    _service = _channelFactory.CreateChannel();
        //}

        public static void CreateDownloadManagerClient()
        {
            if (__downloadManager == null)
                __downloadManager = new DownloadManagerClient(XmlConfig.CurrentConfig.Get("DownloadAutomateManager/DownloadManager/Address"));
        }