Beispiel #1
0
 /// <summary>
 /// 创建通道实例,huhm2008
 /// </summary>
 /// <typeparam name="T">服务接口</typeparam>
 /// <param name="serviceAddressType">服务地址类型</param>
 /// <returns>已封装了客户端行为的接口通道新实例</returns>
 public static T CreateChannel <T>(ServiceAddressType serviceAddressType)
 {
     return(ClientWCFServiceHelper.CreateChannel <T>(ClientWCFServiceHelper.GetDataBinding(),
                                                     ClientWCFServiceHelper.GetEndPointAddress(ServiceType.Data, serviceAddressType.ToString())));
 }
 /// <summary>
 /// 创建通道实例,huhm2008
 /// 默认将缓存通道
 /// </summary>
 /// <typeparam name="T">服务接口</typeparam>
 /// <param name="serviceAddressType">服务地址类型</param>
 /// <param name="openTimeout">打开连接超时时间默认2分钟</param>
 /// <param name="receiveTimeout">接收数据超时时间默认5分钟</param>
 /// <returns>已封装了客户端行为的接口通道新实例</returns>
 public static T CreateChannel <T>(ServiceAddressType serviceAddressType, int openTimeout, int receiveTimeout)
 {
     return(ClientWCFServiceHelper.CreateChannel <T>(ClientWCFServiceHelper.GetDataBinding(openTimeout, receiveTimeout),
                                                     ClientWCFServiceHelper.GetEndPointAddress(ServiceType.Data, serviceAddressType.ToString())));
 }