Пример #1
0
        /// <summary>
        /// Called once on applicationstart to initialize WCFService-Client
        /// </summary>
        /// <param name="strEndpointAddress">The endpointAdress to connect to</param>
        public WcfClient(String strEndpointAddress)
        {
            EndpointAddress endpointAddress = new EndpointAddress(strEndpointAddress);

            if (_channel != null)
            {
                return;
            }

            WSHttpBinding wsHttpBinding = new WSHttpBinding
            {
                OpenTimeout            = new TimeSpan(0, 1, 0),
                ReceiveTimeout         = new TimeSpan(0, 1, 0),
                SendTimeout            = new TimeSpan(0, 1, 0),
                BypassProxyOnLocal     = false,
                TransactionFlow        = false,
                HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
                MaxBufferPoolSize      = 2147483647,
                MaxReceivedMessageSize = 2147483647,
                MessageEncoding        = WSMessageEncoding.Text,
                TextEncoding           = Encoding.UTF8,
                UseDefaultWebProxy     = true,
                AllowCookies           = false,
                ReaderQuotas           = new XmlDictionaryReaderQuotas
                {
                    MaxArrayLength         = 2147483647,
                    MaxBytesPerRead        = 2147483647,
                    MaxDepth               = 2147483647,
                    MaxNameTableCharCount  = 2147483647,
                    MaxStringContentLength = 2147483647
                },
                ReliableSession = new OptionalReliableSession
                {
                    Ordered           = true,
                    InactivityTimeout = new TimeSpan(0, 1, 0),
                    Enabled           = true
                },
                Security = new WSHttpSecurity
                {
                    Mode = SecurityMode.None
                }
            };


            _httpFactory = new ChannelFactory <ISlimServerService>(wsHttpBinding, endpointAddress);
            _channel     = _httpFactory.CreateChannel();
        }
Пример #2
0
		/// <summary>
		/// Called once on applicationstart to initialize WCFService-Client
		/// </summary>
		/// <param name="strEndpointAddress">The endpointAdress to connect to</param>
		public WcfClient(String strEndpointAddress)
		{
			EndpointAddress endpointAddress = new EndpointAddress(strEndpointAddress);
			if (_channel != null) 
				return;

			WSHttpBinding wsHttpBinding = new WSHttpBinding
			{
				OpenTimeout = new TimeSpan(0, 1, 0),
				ReceiveTimeout = new TimeSpan(0, 1, 0),
				SendTimeout = new TimeSpan(0, 1, 0),
				BypassProxyOnLocal = false,
				TransactionFlow = false,
				HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
				MaxBufferPoolSize = 2147483647,
				MaxReceivedMessageSize = 2147483647,
				MessageEncoding = WSMessageEncoding.Text,
				TextEncoding = Encoding.UTF8,
				UseDefaultWebProxy = true,
				AllowCookies = false,
				ReaderQuotas = new XmlDictionaryReaderQuotas
				{
					MaxArrayLength = 2147483647,
					MaxBytesPerRead = 2147483647,
					MaxDepth = 2147483647,
					MaxNameTableCharCount = 2147483647,
					MaxStringContentLength = 2147483647
				},
				ReliableSession = new OptionalReliableSession
				{
					Ordered = true,
					InactivityTimeout = new TimeSpan(0, 1, 0),
					Enabled = true
				},
				Security = new WSHttpSecurity
				{
					Mode = SecurityMode.None
				}
			};


			_httpFactory = new ChannelFactory<ISlimServerService>(wsHttpBinding, endpointAddress);
			_channel = _httpFactory.CreateChannel();

		}
Пример #3
0
 /// <summary>
 /// Called once on applicationstart to initialize WCFService-Client
 /// </summary>
 public WcfClient()
 {
     _httpFactory = new ChannelFactory <ISlimServerService>("SlimServerServiceEndpoint");
     _channel     = _httpFactory.CreateChannel();
 }
Пример #4
0
		/// <summary>
		/// Called once on applicationstart to initialize WCFService-Client
		/// </summary>
		public WcfClient()
		{
			_httpFactory = new ChannelFactory<ISlimServerService>("SlimServerServiceEndpoint");
			_channel = _httpFactory.CreateChannel();
		}