WCF采用基于契约的服务调用方法,通过System.ServiceModel.ChannelFactory<TChannel>直接创建服务代理对象. 创建服务代理 public static T Create<T>(string endpointName) { if (string.IsNullOrEmpty(endpointName)) { #region 默认配置,根据类名,赋值endpointName #endregion throw new ArgumentNullExce…
知道WCF的地址用工厂通道方式快速调用WCF 1 using System; 2 using System.ServiceModel; 3 using System.ServiceModel.Description; 4 using System.ServiceModel.Channels; 5 6 namespace ZhiYuan.ServiceProxy 7 { 8 public class WCFClient<T> 9 { 10 11 …