コード例 #1
0
        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();
        }
コード例 #2
0
 public AppPreferences()
 {
     ClientCredential = new ClientCredential();
     ConnectionProperties = new WcfConnectionProperties();
 }
コード例 #3
0
 public WcfCrmClient(WcfConnectionProperties connectionProperties, ClientCredential userCredentials)
 {
     _connectionProperties = connectionProperties;
     _clientCredential = userCredentials;
 }