public CommandFactory( IWcfClient wcfClient, IProcessClient processClient, IConfigProvider configProvider, IMessageSender messageSender, ITPLFactory tPLFactory) { this.wcfClient = wcfClient; this.processClient = processClient; this.configProvider = configProvider; this.messageSender = messageSender; this.tPLFactory = tPLFactory; }
public void TestInitialize() { m_serviceScope = _testFactory.Server.Host.Services.CreateScope(); m_transactionScope = new TransactionScope(); TestDataHelper.serviceScope = m_serviceScope; m_wcfClient = GetInstance <IWcfClient>(); m_configurationProvider = GetInstance <IWcfConfigurationProvider>(); m_OrgUnitService = GetInstance <IOrgUnitsService>(); var config = GetInstance <IConfiguration>(); TestdepId_1 = config.GetValue <long>("TestDepid1", 1); TestdepId_2 = config.GetValue <long>("TestDepid2", 22); }
public WcfClient(string name) { switch (name) { case "Excel": _Client = new WcfClientForExcel(); break; case "Other": _Client = new WcfClientForApps(); break; default: _Client = new WcfClientForApps(); break; } Service = _Client.Service; }
public Core( IDataProvider dataProvider, IWcfClient wcfClient, IMetamorphoses metamorphosis, IXmlSerializer xmlSerializer, IExcelService excelService, ICellsNormalizer cellsNormalizer, IPluginService pluginService) { this.metamorphosis = metamorphosis; this.xmlSerializer = xmlSerializer; this.excelService = excelService; this.dataProvider = dataProvider; this.wcfClient = wcfClient; this.cellsNormalizer = cellsNormalizer; this.pluginService = pluginService; DeserializeConfigs(); dataProvider.Configure(config.ConnectionString); dataProvider.Configure(config.ConnectionTimeOut); dataProvider.Init(); wcfClient.SetUrl(config.WcfServiceAddress); Initializing(); }
private async void OnConnect(object o) { if (string.IsNullOrWhiteSpace(PlayerName)) { ConnectionError = "You name is empty"; return; } await Task.Factory.StartNew( () => { try { using (ConnectionView()) { string sessionId = null; if (_userService.Use(service => service.Login(_playerName, out sessionId))) { SessionId = sessionId; _chessClient = _chessService.Create(_serviceCallback); _chessClient.Service.Ready(sessionId); OpponentView(); } else { ConnectionError = "Login failed"; } } } catch (Exception ex) { ConnectionError = ex.Message; } }); }
private void InitializeClient(string bindingType, int port, string relativePath) { relativePath = relativePath.TrimStart('/'); var bindingTypeEnum = (WCFBindingType)Enum.Parse(typeof(WCFBindingType), bindingType); var endpointAddress = WCFLibraryHelpers.GetEndpointAddress(bindingTypeEnum, port, relativePath); switch (bindingTypeEnum) { case WCFBindingType.BasicHttp: _wcfClient = CreateClientWithHttpBinding(endpointAddress); break; case WCFBindingType.WSHttp: _wcfClient = CreateClientWithWSHttpBinding(endpointAddress); break; case WCFBindingType.WebHttp: _wcfClient = CreateClientWithWebHttpBinding(endpointAddress); break; case WCFBindingType.NetTcp: _wcfClient = CreateClientWithNetTCPBinding(endpointAddress); break; case WCFBindingType.Custom: _wcfClient = CreateClientWithCustomBinding(endpointAddress); break; case WCFBindingType.CustomClass: _wcfClient = CreateClientWithCustomBinding(endpointAddress, "CustomWcfBinding"); break; default: throw new NotImplementedException($"Binding Type {bindingTypeEnum}"); } }
public OrgUnitsService(IWcfClient client, IWcfConfigurationProvider config, IMemoryCache cache) { m_wcfClient = client; m_configurationProvider = config; m_cache = cache; }
protected CachedClient(IWcfClient client) { this.disposeTracker = this.GetDisposeTracker(); this.Client = client; }