Index: /trunk/sources/HeuristicLab.Clients.Common/3.3/ClientFactory.cs
===================================================================
--- /trunk/sources/HeuristicLab.Clients.Common/3.3/ClientFactory.cs	(revision 5526)
+++ /trunk/sources/HeuristicLab.Clients.Common/3.3/ClientFactory.cs	(revision 5527)
@@ -22,8 +22,6 @@
 using System;
 using System.ServiceModel;
+using System.ServiceModel.Description;
 using HeuristicLab.Clients.Common.Properties;
-using System.ServiceModel.Description;
-using System.Collections;
-using System.Collections.Generic;
 using HeuristicLab.Common;
 
@@ -65,11 +63,11 @@
     }
 
-    public static Disposable<I> CreateClient<I>(string endpointConfigurationName) where I : class {
-      return CreateClient<I>(endpointConfigurationName, null);
+    public static Disposable<ChannelFactory<I>> CreateChannelFactory<I>(string endpointConfigurationName) where I : class {
+      return CreateChannelFactory<I>(endpointConfigurationName, null);
     }
-    public static Disposable<I> CreateClient<I>(string endpointConfigurationName, string remoteAddress) where I : class {
-      return CreateClient<I>(endpointConfigurationName, remoteAddress, Settings.Default.UserName, Settings.Default.Password);
+    public static Disposable<ChannelFactory<I>> CreateChannelFactory<I>(string endpointConfigurationName, string remoteAddress) where I : class {
+      return CreateChannelFactory<I>(endpointConfigurationName, remoteAddress, Settings.Default.UserName, Settings.Default.Password);
     }
-    public static Disposable<I> CreateClient<I>(string endpointConfigurationName, string remoteAddress, string userName, string password) where I : class {
+    public static Disposable<ChannelFactory<I>> CreateChannelFactory<I>(string endpointConfigurationName, string remoteAddress, string userName, string password) where I : class {
       ChannelFactory<I> factory = GetChannelFactory<I>(endpointConfigurationName, userName, password);
 
@@ -77,7 +75,6 @@
         SetEndpointAddress(factory.Endpoint, remoteAddress);
       }
-      Disposable<I> disposable = new Disposable<I>(factory.CreateChannel());
+      var disposable = new Disposable<ChannelFactory<I>>(factory);
       disposable.OnDisposing += new EventHandler<EventArgs<object>>(disposable_OnDisposing);
-
       return disposable;
     }
@@ -88,14 +85,10 @@
     }
 
-    private static IDictionary<ChannelProperties, ChannelFactory> channelFactoryCache = new Dictionary<ChannelProperties, ChannelFactory>();
     private static ChannelFactory<I> GetChannelFactory<I>(string endpointConfigurationName, string userName, string password) where I : class {
-      ChannelProperties key = new ChannelProperties(typeof(I), endpointConfigurationName, userName, password);
-      if (!channelFactoryCache.ContainsKey(key)) {
-        channelFactoryCache.Add(key, new ChannelFactory<I>(endpointConfigurationName));
-        channelFactoryCache[key].Credentials.UserName.UserName = userName;
-        channelFactoryCache[key].Credentials.UserName.Password = password;
-        channelFactoryCache[key].Credentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None;
-      }
-      return (ChannelFactory<I>)channelFactoryCache[key];
+      var channelFactory = new ChannelFactory<I>(endpointConfigurationName);
+      channelFactory.Credentials.UserName.UserName = userName;
+      channelFactory.Credentials.UserName.Password = password;
+      channelFactory.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None;
+      return channelFactory;
     }
 
@@ -122,17 +115,3 @@
     }
   }
-
-  internal struct ChannelProperties {
-    public Type type;
-    public string endpointConfigurationName;
-    public string userName;
-    public string password;
-
-    public ChannelProperties(Type type, string endpointConfigurationName, string userName, string password) {
-      this.type = type;
-      this.endpointConfigurationName = endpointConfigurationName;
-      this.userName = userName;
-      this.password = password;
-    }
-  }
 }
