public void Initialize(string serviceId)
        {
            var service = this.consulService.GetServiceInfo(serviceId).First();
            this.busConnectionDetails = new BusConnectionDetails(service.Address);
            this.bus = this.busFactory.BootstrapService(this.busConnectionDetails);
            this.serviceDetails = service;

            this.contractInitializationService.Initialize(serviceDetails);
        }
        public void Initialize(GetServiceInfoResponse serviceDetails)
        {

            if (!ContractCache.Exists(serviceDetails.Id))
            {
                var url = string.Concat("http://", serviceDetails.Address, ":8910", "/ContractLibrary.dll");
                downloader.Download(url, string.Concat("./", serviceDetails.Id, ".dll"));

                ContractCache.Add(serviceDetails.Id);
            }

            if (!ServiceOperationCache.Exists(serviceDetails.Id))
            {                
                var assembly = Assembly.Load("ContractLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");
                //var assembly = Assembly.LoadFile(Path.GetFullPath(string.Concat("./", serviceDetails.ID, ".dll")));                
                var operations = assembly.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IOperationDescription)) && !t.IsInterface);
                var operationDescriptions = operations.Select(o => Activator.CreateInstance(o) as IOperationDescription);                

                ServiceOperationCache.Add(serviceDetails.Id, operationDescriptions);
            }
        }