namespace FineUIPro.Web
{
    using System;
    using System.Configuration;
    using System.ServiceModel;
    using System.Collections.Generic;
    using System.Linq;
    using BLL;
    using System.Xml;
   
    public static class ServiceProxy
    {
        ///// 
        ///// 创建客户端服务
        ///// 
        //public static HSSEService.HSSEServiceClient CreateServiceClient()
        //{           
        //    string address = ConfigurationManager.AppSettings["endpoint"];            
        //    var proxy = new HSSEService.HSSEServiceClient();
        //    ConfigEndpointAddress(proxy, address);
        //    return proxy;
        //}
        /// 
        /// 根据web.config中服务器端主机地址配置服务通道的终端地址。
        /// 
        /// 通道类型
        /// 代理
        /// 服务访问地址
        public static void ConfigEndpointAddress(System.ServiceModel.ClientBase proxy, string endpointAddress)
            where TChannel : class
        {
            Uri endpointUri = new Uri(endpointAddress);            
            EndpointAddress endPointAddress = new EndpointAddress(endpointUri);            
            proxy.Endpoint.Address = endPointAddress;            
        }       
    }
}