示例#1
0
        public LinkClient(string remoteAddress)
        {
            InstanceContext   context       = new InstanceContext(this);
            WSDualHttpBinding binding       = new WSDualHttpBinding();
            Uri             address         = new Uri(remoteAddress);
            EndpointAddress endpointAddress = new EndpointAddress(address);

            //proxy = new LinkServiceClient(context);
            proxy = new LinkServiceClient(context, binding, endpointAddress);
            proxy.SubscribeEvent();
        }
示例#2
0
        private LinkServiceClient InitializeClient()
        {
            LinkServiceClient service;

            if (_webServiceUrl.StartsWith("https://"))
            {
                var binding = new BasicHttpBinding()
                    {
                        Security = { Mode = BasicHttpSecurityMode.Transport },
                        MaxReceivedMessageSize = 67108864,
                        SendTimeout = new TimeSpan(0,5,0),
                        ReceiveTimeout = new TimeSpan(0, 5, 0)
                    };
                var endpoint = new EndpointAddress(_webServiceUrl);

                // push the results to the server
                service = new LinkServiceClient(binding, endpoint);
            }
            else
            {
                var binding = new BasicHttpBinding() { MaxReceivedMessageSize = 67108864
                    , SendTimeout = new TimeSpan(0,5,0)
                    , ReceiveTimeout = new TimeSpan(0, 5, 0) };
                var endpoint = new EndpointAddress(_webServiceUrl);

                service = new LinkServiceClient(binding, endpoint);
            }

            return service;
        }