주소를 사용하여 끝점을 만들고 웹 서비스에서 지원하는 바인딩을 기반으로 바인딩을 만들면 프록시를 만들고 서비스를 소비하게됩니다.
// Specify an end point address of the service
EndpointAddress endpointAdress = new EndpointAddress(serviceUrl);
// Create the binding to be used by the service
BasicHttpBinding binding1 = new BasicHttpBinding();
//customize the binding configurations like the ones below
binding.SendTimeout = TimeSpan.FromMinutes(1);
binding.OpenTimeout = TimeSpan.FromMinutes(1);
binding.CloseTimeout = TimeSpan.FromMinutes(1);
binding.ReceiveTimeout = TimeSpan.FromMinutes(10);
//create the client proxy using the specific endpoint and binding you have created
YourServiceClient proxy = new YourServiceClient(binding1, endpointAddress);
또는 당신이에 표시됩니다 일반적인 접근 방식 따르도록 ChannelFactory
을 사용할 수있는 방법을-가이드 here