Exemple #1
0
        public static WcfChannelWrapper <T> CreateWcfChannel <T>()
            where T : class
        {
            ChannelFactory cf;

            if (!_cfCache.TryGetValue(typeof(T), out cf))
            {
                lock (_cfCacheLock)
                {
                    if (!_cfCache.TryGetValue(typeof(T), out cf))
                    {
                        var endpoint = WcfConfigurationLoader.LoadWcfClientEndpointConfiguration(typeof(T));
                        cf = WcfChannelFactoryFactory.CreateChannelFactory <T>(endpoint);
                        _cfCache[typeof(T)] = cf;
                    }
                }
            }

            return(new WcfChannelWrapper <T>((cf as ChannelFactory <T>).CreateChannel()));
        }
 public override WcfService LoadServiceConfiguration(Type serviceType)
 {
     return(WcfConfigurationLoader.LoadWcfServiceConfiguration(serviceType));
 }