private void InitServiceHost(WcfConnectionProperties connectionProperties = null) { if (_serviceHost != null) _serviceHost.Abort(); int max = 5000000; var tcpBinding = new NetTcpBinding(); tcpBinding.Security.Mode = SecurityMode.None; tcpBinding.OpenTimeout = TimeSpan.FromMinutes(10); tcpBinding.ReceiveTimeout = TimeSpan.FromMinutes(1); tcpBinding.MaxBufferSize = max; tcpBinding.MaxReceivedMessageSize = max; tcpBinding.ReaderQuotas.MaxArrayLength = max; _serviceHost = new ServiceHost(new WcfCrmServer(), new Uri(connectionProperties == null ? WcfConnectionProperties.Default.ConnectionString : connectionProperties.ConnectionString)); _serviceHost.AddServiceEndpoint(typeof(ICrmServer), tcpBinding, "CrmServer"); _serviceHost.Open(); }
public AppPreferences() { ClientCredential = new ClientCredential(); ConnectionProperties = new WcfConnectionProperties(); }
public WcfCrmClient(WcfConnectionProperties connectionProperties, ClientCredential userCredentials) { _connectionProperties = connectionProperties; _clientCredential = userCredentials; }