Index: branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/AuthenticationClient.cs
===================================================================
--- branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/AuthenticationClient.cs	(revision 4962)
+++ branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/AuthenticationClient.cs	(revision 4962)
@@ -0,0 +1,186 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Services.Authentication;
+using System.ServiceModel.Security;
+using System.ServiceModel;
+
+namespace HeuristicLab.Services.Authentication.ServiceClients
+{
+    public class AuthenticationClient
+    {
+
+        private static AuthenticationClient instance;
+        public static AuthenticationClient Instance
+        {
+            get
+            {
+                if (instance == null) instance = new AuthenticationClient();
+                return instance;
+            }
+        }
+
+        #region Properties
+
+        private IEnumerable<User> users;
+        public IEnumerable<User> Users
+        {
+            get { return users; }
+        }
+        private IEnumerable<Application> applications;
+        public IEnumerable<Application> Applications
+        {
+            get { return applications; }
+        }
+
+        private IEnumerable<Role> roles;
+        public IEnumerable<Role> Roles
+        {
+            get { return roles; }
+        }
+
+        #endregion
+
+
+        private AuthenticationClient()
+        {
+            applications = CallService<Application[]>(s => s.GetApplications()).OrderBy(x => x.Name);
+        }
+
+
+
+        #region Store
+
+        public bool Store(AuthItem item)
+        {
+            try
+            {
+                if (item.Id == Guid.Empty)
+                {
+                    if (item is Role)
+                        item.Id = CallService<Guid>(s => s.InsertRole((Role)item));
+                    else if (item is User)
+                        item.Id = CallService<Guid>(s => s.InsertUser((User)item));
+                    else if (item is Application)
+                        item.Id = CallService<Guid>(s => s.InsertApplication((Application)item));
+
+                }
+                else
+                {
+                    if (item is Role)
+                        CallService(s => s.UpdateRole((Role)item));
+                    else if (item is User)
+                        CallService(s => s.UpdateUser((User)item));
+                    else if (item is Application)
+                        CallService(s => s.UpdateApplication((Application)item));
+
+                }
+                return true;
+            }
+            catch (Exception ex)
+            {
+                //ErrorHandling.ShowErrorDialog("Store failed.", ex);
+                return false;
+            }
+        }
+
+        #endregion
+
+        #region Refresh
+
+        public void Refresh()
+        {
+
+            var call = new Func<Exception>(delegate()
+            {
+
+                Guid applicationId = Guid.Empty; // to be set!
+
+                try
+                {
+                    users = CallService<User[]>(s => s.GetUsers(applicationId)).OrderBy(x => x.Name);
+                    roles = CallService<Role[]>(s => s.GetRoles(applicationId)).OrderBy(x => x.Name);
+                    
+                    // ...
+
+                    return null;
+                }
+                catch (Exception ex)
+                {
+                    return ex;
+                }
+            });
+            call.BeginInvoke(delegate(IAsyncResult result)
+            {
+                Exception ex = call.EndInvoke(result);
+                if (ex != null)
+                {
+                    //ErrorHandling.ShowErrorDialog("Refresh failed.", ex);
+                }
+
+            }, null);
+        }
+
+
+        #endregion
+
+        private T CallService<T>(Func<IAuthenticationService, T> call)
+        {
+            AuthenticationServiceClient client = new AuthenticationServiceClient();
+            client.ClientCredentials.UserName.UserName = "Alice";
+            client.ClientCredentials.UserName.Password = "YouWillKnow";
+            client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
+            //AuthenticationServiceClient client = ClientFactory.Create<AuthenticationClient, IAuthenticationService>();
+            try
+            {
+                return call(client);
+            }
+            finally
+            {
+                try
+                {
+                    client.Close();
+                }
+                catch (Exception)
+                {
+                    client.Abort();
+                }
+            }
+        }
+
+
+        #region Application methods
+
+        public Application GetApplication(Guid applicationId)
+        {
+            try
+            {
+                return CallService<Application>(s => s.GetApplication(applicationId));
+            }
+            catch (Exception ex)
+            {
+                //ErrorHandling.ShowErrorDialog("Refresh problem data failed.", ex);
+                return null;
+            }
+        }
+
+ 
+        #endregion
+
+
+        //public static void Main() {
+        //    AuthenticationServiceClient auth = new AuthenticationServiceClient();
+
+        //    auth.ClientCredentials.UserName.UserName = "Alice";
+        //    auth.ClientCredentials.UserName.Password = "YouWillKnow";
+        //    auth.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
+
+        //    Application[] apps = auth.GetApplications();
+        //    foreach (Application app in apps) {
+        //        Console.WriteLine(app.Name);
+        //    }
+        //    Console.ReadLine();
+        //}
+    }
+}
Index: branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/Client.cs
===================================================================
--- branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/Client.cs	(revision 4940)
+++ 	(revision )
@@ -1,40 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using HeuristicLab.Services.Authentication.ServiceClient;
-
-namespace HeuristicLab.Services.Authentication.ServiceClients
-{
-   public class AuthenticationClient
-    {
-
-     private static AuthenticationClient instance;
-     public static AuthenticationClient Instance {
-       get {
-         if (instance == null) instance = new AuthenticationClient();
-         return instance;
-       }
-     }
-
-     #region properties
-
-     public void createconnection() {
-
-       AuthenticationServiceClient service = new AuthenticationServiceClient();
-       IList<User> users = service.GetUsers(new Guid("a3961e10 - 0691 - 4e6d - aede - fd838c3a929a"));
-       foreach (User u in users) {
-         Console.WriteLine(u.ToString());
-       }
-     }
-
-
-     #endregion
-
-     public static void Main() {
-       AuthenticationClient auth = new AuthenticationClient();
-       auth.createconnection();
-
-     }
-   }
-}
Index: branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ClientFactory.cs
===================================================================
--- branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ClientFactory.cs	(revision 4962)
+++ branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ClientFactory.cs	(revision 4962)
@@ -0,0 +1,28 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.ServiceModel;
+
+namespace HeuristicLab.Services.Authentication
+{
+    public class ClientFactory
+    {
+
+        public static T Create<T, I>()
+            where T : ClientBase<I>, I
+            where I : class
+        {
+            var client = Activator.CreateInstance<T>();
+            client.ClientCredentials.UserName.UserName = "Alice";
+            client.ClientCredentials.UserName.Password = "YouWillKnow";
+            client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None;
+
+            return client;
+
+        }
+
+    }
+
+}
+
Index: branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/HeuristicLab.Services.Authentication.ServiceClient.csproj
===================================================================
--- branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/HeuristicLab.Services.Authentication.ServiceClient.csproj	(revision 4940)
+++ branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/HeuristicLab.Services.Authentication.ServiceClient.csproj	(revision 4962)
@@ -7,7 +7,7 @@
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{8E698904-936D-4C7A-AB0D-6225778D2968}</ProjectGuid>
-    <OutputType>Exe</OutputType>
+    <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>HeuristicLab.Services.Authentication.ServiceClients</RootNamespace>
+    <RootNamespace>HeuristicLab.Services.Authentication</RootNamespace>
     <AssemblyName>HeuristicLab.Services.Authentication.ServiceClients</AssemblyName>
     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
@@ -37,4 +37,5 @@
     <Reference Include="System" />
     <Reference Include="System.Core" />
+    <Reference Include="System.Data.Linq" />
     <Reference Include="System.Runtime.Serialization" />
     <Reference Include="System.ServiceModel" />
@@ -46,5 +47,6 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Client.cs" />
+    <Compile Include="AuthenticationClient.cs" />
+    <Compile Include="ClientFactory.cs" />
     <Compile Include="ServiceClients\Application.cs" />
     <Compile Include="ServiceClients\AuthenticationServiceClient.cs" />
@@ -58,4 +60,13 @@
     <None Include="ServiceClients\GenerateServiceClients.cmd" />
   </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\HeuristicLab.Services.Authentication\HeuristicLab.Services.Authentication.csproj">
+      <Project>{0E7ADDD6-C7EA-45F6-A7ED-48041ABF1A87}</Project>
+      <Name>HeuristicLab.Services.Authentication</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <WCFMetadata Include="Service References\" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
Index: branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/HeuristicLab.Services.Authentication.ServiceClient.csproj.user
===================================================================
--- branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/HeuristicLab.Services.Authentication.ServiceClient.csproj.user	(revision 4962)
+++ branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/HeuristicLab.Services.Authentication.ServiceClient.csproj.user	(revision 4962)
@@ -0,0 +1,6 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectView>ShowAllFiles</ProjectView>
+  </PropertyGroup>
+</Project>
Index: branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/Application.cs
===================================================================
--- branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/Application.cs	(revision 4940)
+++ branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/Application.cs	(revision 4962)
@@ -4,5 +4,5 @@
 using System.Text;
 
-namespace HeuristicLab.Services.Authentication.ServiceClient
+namespace HeuristicLab.Services.Authentication
 {
     public partial class Application
Index: branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/AuthenticationServiceClient.cs
===================================================================
--- branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/AuthenticationServiceClient.cs	(revision 4940)
+++ branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/AuthenticationServiceClient.cs	(revision 4962)
@@ -9,5 +9,5 @@
 //------------------------------------------------------------------------------
 
-namespace HeuristicLab.Services.Authentication.ServiceClient
+namespace HeuristicLab.Services.Authentication
 {
     using System.Runtime.Serialization;
@@ -18,8 +18,8 @@
     [System.Runtime.Serialization.DataContractAttribute(Name="AuthItem", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Authentication.Data" +
         "Transfer")]
-    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.ServiceClient.NamedAuthItem))]
-    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.ServiceClient.Role))]
-    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.ServiceClient.Application))]
-    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.ServiceClient.User))]
+    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.NamedAuthItem))]
+    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.Role))]
+    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.Application))]
+    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.User))]
     public partial class AuthItem : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged
     {
@@ -74,8 +74,8 @@
     [System.Runtime.Serialization.DataContractAttribute(Name="NamedAuthItem", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Authentication.Data" +
         "Transfer")]
-    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.ServiceClient.Role))]
-    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.ServiceClient.Application))]
-    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.ServiceClient.User))]
-    public partial class NamedAuthItem : HeuristicLab.Services.Authentication.ServiceClient.AuthItem
+    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.Role))]
+    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.Application))]
+    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.User))]
+    public partial class NamedAuthItem : HeuristicLab.Services.Authentication.AuthItem
     {
         
@@ -104,5 +104,5 @@
     [System.Runtime.Serialization.DataContractAttribute(Name="Role", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Authentication.Data" +
         "Transfer")]
-    public partial class Role : HeuristicLab.Services.Authentication.ServiceClient.NamedAuthItem
+    public partial class Role : HeuristicLab.Services.Authentication.NamedAuthItem
     {
         
@@ -169,5 +169,5 @@
     [System.Runtime.Serialization.DataContractAttribute(Name="Application", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Authentication.Data" +
         "Transfer")]
-    public partial class Application : HeuristicLab.Services.Authentication.ServiceClient.NamedAuthItem
+    public partial class Application : HeuristicLab.Services.Authentication.NamedAuthItem
     {
         
@@ -215,5 +215,5 @@
     [System.Runtime.Serialization.DataContractAttribute(Name="User", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Authentication.Data" +
         "Transfer")]
-    public partial class User : HeuristicLab.Services.Authentication.ServiceClient.NamedAuthItem
+    public partial class User : HeuristicLab.Services.Authentication.NamedAuthItem
     {
         
@@ -448,16 +448,16 @@
     
     [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
-    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="HeuristicLab.Services.Authentication.ServiceClient.IAuthenticationService")]
+    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="HeuristicLab.Services.Authentication.IAuthenticationService")]
     public interface IAuthenticationService
     {
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetUser", ReplyAction="http://tempuri.org/IAuthenticationService/GetUserResponse")]
-        HeuristicLab.Services.Authentication.ServiceClient.User GetUser(System.Guid id);
+        HeuristicLab.Services.Authentication.User GetUser(System.Guid id);
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetUsers", ReplyAction="http://tempuri.org/IAuthenticationService/GetUsersResponse")]
-        HeuristicLab.Services.Authentication.ServiceClient.User[] GetUsers(System.Guid applicationId);
+        HeuristicLab.Services.Authentication.User[] GetUsers(System.Guid applicationId);
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/InsertUser", ReplyAction="http://tempuri.org/IAuthenticationService/InsertUserResponse")]
-        bool InsertUser(HeuristicLab.Services.Authentication.ServiceClient.User user);
+        System.Guid InsertUser(HeuristicLab.Services.Authentication.User user);
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/DeleteUser", ReplyAction="http://tempuri.org/IAuthenticationService/DeleteUserResponse")]
@@ -465,5 +465,5 @@
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/UpdateUser", ReplyAction="http://tempuri.org/IAuthenticationService/UpdateUserResponse")]
-        bool UpdateUser(HeuristicLab.Services.Authentication.ServiceClient.User user);
+        bool UpdateUser(HeuristicLab.Services.Authentication.User user);
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/AddUserToRole", ReplyAction="http://tempuri.org/IAuthenticationService/AddUserToRoleResponse")]
@@ -474,17 +474,17 @@
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetRolesForUser", ReplyAction="http://tempuri.org/IAuthenticationService/GetRolesForUserResponse")]
-        HeuristicLab.Services.Authentication.ServiceClient.Role[] GetRolesForUser(System.Guid userId);
+        HeuristicLab.Services.Authentication.Role[] GetRolesForUser(System.Guid userId);
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetRole", ReplyAction="http://tempuri.org/IAuthenticationService/GetRoleResponse")]
-        HeuristicLab.Services.Authentication.ServiceClient.Role GetRole(System.Guid id);
+        HeuristicLab.Services.Authentication.Role GetRole(System.Guid id);
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetRoles", ReplyAction="http://tempuri.org/IAuthenticationService/GetRolesResponse")]
-        HeuristicLab.Services.Authentication.ServiceClient.Role[] GetRoles(System.Guid applicationId);
+        HeuristicLab.Services.Authentication.Role[] GetRoles(System.Guid applicationId);
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/InsertRole", ReplyAction="http://tempuri.org/IAuthenticationService/InsertRoleResponse")]
-        bool InsertRole(HeuristicLab.Services.Authentication.ServiceClient.Role role);
+        System.Guid InsertRole(HeuristicLab.Services.Authentication.Role role);
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/UpdateRole", ReplyAction="http://tempuri.org/IAuthenticationService/UpdateRoleResponse")]
-        bool UpdateRole(HeuristicLab.Services.Authentication.ServiceClient.Role role);
+        bool UpdateRole(HeuristicLab.Services.Authentication.Role role);
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/DeleteRole", ReplyAction="http://tempuri.org/IAuthenticationService/DeleteRoleResponse")]
@@ -492,11 +492,11 @@
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetUsersInRole", ReplyAction="http://tempuri.org/IAuthenticationService/GetUsersInRoleResponse")]
-        HeuristicLab.Services.Authentication.ServiceClient.User[] GetUsersInRole(System.Guid roleId);
+        HeuristicLab.Services.Authentication.User[] GetUsersInRole(System.Guid roleId);
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetApplication", ReplyAction="http://tempuri.org/IAuthenticationService/GetApplicationResponse")]
-        HeuristicLab.Services.Authentication.ServiceClient.Application GetApplication(System.Guid id);
+        HeuristicLab.Services.Authentication.Application GetApplication(System.Guid id);
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/InsertApplication", ReplyAction="http://tempuri.org/IAuthenticationService/InsertApplicationResponse")]
-        bool InsertApplication(HeuristicLab.Services.Authentication.ServiceClient.Application application);
+        System.Guid InsertApplication(HeuristicLab.Services.Authentication.Application application);
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/DeleteApplication", ReplyAction="http://tempuri.org/IAuthenticationService/DeleteApplicationResponse")]
@@ -504,9 +504,12 @@
         
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetApplications", ReplyAction="http://tempuri.org/IAuthenticationService/GetApplicationsResponse")]
-        HeuristicLab.Services.Authentication.ServiceClient.Application[] GetApplications();
+        HeuristicLab.Services.Authentication.Application[] GetApplications();
+        
+        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/UpdateApplication", ReplyAction="http://tempuri.org/IAuthenticationService/UpdateApplicationResponse")]
+        bool UpdateApplication(HeuristicLab.Services.Authentication.Application application);
     }
     
     [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
-    public interface IAuthenticationServiceChannel : HeuristicLab.Services.Authentication.ServiceClient.IAuthenticationService, System.ServiceModel.IClientChannel
+    public interface IAuthenticationServiceChannel : HeuristicLab.Services.Authentication.IAuthenticationService, System.ServiceModel.IClientChannel
     {
     }
@@ -514,5 +517,5 @@
     [System.Diagnostics.DebuggerStepThroughAttribute()]
     [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
-    public partial class AuthenticationServiceClient : System.ServiceModel.ClientBase<HeuristicLab.Services.Authentication.ServiceClient.IAuthenticationService>, HeuristicLab.Services.Authentication.ServiceClient.IAuthenticationService
+    public partial class AuthenticationServiceClient : System.ServiceModel.ClientBase<HeuristicLab.Services.Authentication.IAuthenticationService>, HeuristicLab.Services.Authentication.IAuthenticationService
     {
         
@@ -541,15 +544,15 @@
         }
         
-        public HeuristicLab.Services.Authentication.ServiceClient.User GetUser(System.Guid id)
+        public HeuristicLab.Services.Authentication.User GetUser(System.Guid id)
         {
             return base.Channel.GetUser(id);
         }
         
-        public HeuristicLab.Services.Authentication.ServiceClient.User[] GetUsers(System.Guid applicationId)
+        public HeuristicLab.Services.Authentication.User[] GetUsers(System.Guid applicationId)
         {
             return base.Channel.GetUsers(applicationId);
         }
         
-        public bool InsertUser(HeuristicLab.Services.Authentication.ServiceClient.User user)
+        public System.Guid InsertUser(HeuristicLab.Services.Authentication.User user)
         {
             return base.Channel.InsertUser(user);
@@ -561,5 +564,5 @@
         }
         
-        public bool UpdateUser(HeuristicLab.Services.Authentication.ServiceClient.User user)
+        public bool UpdateUser(HeuristicLab.Services.Authentication.User user)
         {
             return base.Channel.UpdateUser(user);
@@ -576,25 +579,25 @@
         }
         
-        public HeuristicLab.Services.Authentication.ServiceClient.Role[] GetRolesForUser(System.Guid userId)
+        public HeuristicLab.Services.Authentication.Role[] GetRolesForUser(System.Guid userId)
         {
             return base.Channel.GetRolesForUser(userId);
         }
         
-        public HeuristicLab.Services.Authentication.ServiceClient.Role GetRole(System.Guid id)
+        public HeuristicLab.Services.Authentication.Role GetRole(System.Guid id)
         {
             return base.Channel.GetRole(id);
         }
         
-        public HeuristicLab.Services.Authentication.ServiceClient.Role[] GetRoles(System.Guid applicationId)
+        public HeuristicLab.Services.Authentication.Role[] GetRoles(System.Guid applicationId)
         {
             return base.Channel.GetRoles(applicationId);
         }
         
-        public bool InsertRole(HeuristicLab.Services.Authentication.ServiceClient.Role role)
+        public System.Guid InsertRole(HeuristicLab.Services.Authentication.Role role)
         {
             return base.Channel.InsertRole(role);
         }
         
-        public bool UpdateRole(HeuristicLab.Services.Authentication.ServiceClient.Role role)
+        public bool UpdateRole(HeuristicLab.Services.Authentication.Role role)
         {
             return base.Channel.UpdateRole(role);
@@ -606,15 +609,15 @@
         }
         
-        public HeuristicLab.Services.Authentication.ServiceClient.User[] GetUsersInRole(System.Guid roleId)
+        public HeuristicLab.Services.Authentication.User[] GetUsersInRole(System.Guid roleId)
         {
             return base.Channel.GetUsersInRole(roleId);
         }
         
-        public HeuristicLab.Services.Authentication.ServiceClient.Application GetApplication(System.Guid id)
+        public HeuristicLab.Services.Authentication.Application GetApplication(System.Guid id)
         {
             return base.Channel.GetApplication(id);
         }
         
-        public bool InsertApplication(HeuristicLab.Services.Authentication.ServiceClient.Application application)
+        public System.Guid InsertApplication(HeuristicLab.Services.Authentication.Application application)
         {
             return base.Channel.InsertApplication(application);
@@ -626,8 +629,13 @@
         }
         
-        public HeuristicLab.Services.Authentication.ServiceClient.Application[] GetApplications()
+        public HeuristicLab.Services.Authentication.Application[] GetApplications()
         {
             return base.Channel.GetApplications();
         }
+        
+        public bool UpdateApplication(HeuristicLab.Services.Authentication.Application application)
+        {
+            return base.Channel.UpdateApplication(application);
+        }
     }
 }
Index: branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/GenerateServiceClients.cmd
===================================================================
--- branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/GenerateServiceClients.cmd	(revision 4940)
+++ branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/GenerateServiceClients.cmd	(revision 4962)
@@ -1,34 +1,34 @@
 ﻿echo off
 
-echo.
+echo
 echo *******************************************************************************************
 echo Generating OKBService client
-echo.
+echo
 
 svcutil.exe ^
-http://localhost:8732/Design_Time_Addresses/OKB-3.3/AuthenticationService/mex ^
+http://localhost:8732/Design_Time_Addresses/HeuristicLab.Services.Authentication/AuthenticationService/mex ^
 /out:AuthenticationServiceClient ^
-/namespace:*,HeuristicLab.Services.Authentication.ServiceClient ^
+/namespace:*,HeuristicLab.Services.Authentication ^
 /targetClientVersion:Version35 ^
 /enableDataBinding ^
 /config:..\app.config
 
-echo.
+echo
 echo ---------------------------------------------------------------------------------------
 echo !!! ATTENTION !!! ATTENTION !!! ATTENTION !!! ATTENTION !!! ATTENTION !!! ATTENTION !!!
-echo.
+echo
 echo Following modifications have to be done manually in generated data contracts:
 echo  * Remove method "protected void RaisePropertyChanged(string propertyName)" in OKBItem
-echo.
+echo
 echo !!! ATTENTION !!! ATTENTION !!! ATTENTION !!! ATTENTION !!! ATTENTION !!! ATTENTION !!!
 echo ---------------------------------------------------------------------------------------
-echo.
+echo
 echo Generation of OKBService client finished.
 echo *******************************************************************************************
-echo.
-echo.
+echo
+echo
 echo *******************************************************************************************
 echo Generating AuthenticationService client
-echo.
+echo
 
 
Index: branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/Role.cs
===================================================================
--- branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/Role.cs	(revision 4940)
+++ branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/Role.cs	(revision 4962)
@@ -4,8 +4,11 @@
 using System.Text;
 
-namespace HeuristicLab.Services.Authentication.ServiceClient
+namespace HeuristicLab.Services.Authentication
 {
     public partial class Role
     {
+
+        //  IEnumerable<User> Users;
+
     }
 }
Index: branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/User.cs
===================================================================
--- branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/User.cs	(revision 4940)
+++ branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/User.cs	(revision 4962)
@@ -4,8 +4,10 @@
 using System.Text;
 
-namespace HeuristicLab.Services.Authentication.ServiceClient
+namespace HeuristicLab.Services.Authentication
 {
     public partial class User
     {
+        // IEnumerable<Role> Roles
+
     }
 }
Index: branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/app.config
===================================================================
--- branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/app.config	(revision 4940)
+++ branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/app.config	(revision 4962)
@@ -1,38 +1,36 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <configuration>
-  <system.serviceModel>
-    <bindings>
-      <wsHttpBinding>
-      
-        <binding name="WSHttpBinding_IAuthenticationService" closeTimeout="00:01:00"
-            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
-            bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
-            maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
-            messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
-            allowCookies="false">
-          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
-              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
-          <reliableSession ordered="true" inactivityTimeout="00:10:00"
-              enabled="false" />
-          <security mode="Message">
-            <transport clientCredentialType="Windows" proxyCredentialType="None"
-                realm="" />
-            <message clientCredentialType="UserName" negotiateServiceCredential="true"
-                algorithmSuite="Default" />
-          </security>
-        </binding>
-      </wsHttpBinding>
-    </bindings>
-    <client>
-     
-      <endpoint address="http://localhost:8732/Design_Time_Addresses/HeuristicLab.Services.Authentication/AuthenticationService"
-          binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAuthenticationService"
-          contract="HeuristicLab.Services.Authentication.IAuthenticationService"
-          name="WSHttpBinding_IAuthenticationService">
-        <identity>
-          <certificate encodedValue="AwAAAAEAAAAUAAAAD/AlkYJw/OUhl6D/9w8mjJBh39kgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhAdEzTisaf2sEZxrqYZfYtCMAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMDgyMDIyMzIwOFoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPkfCSLRX8/4F+Z4ys43yZ4MMzjB44cMakPz4Nri+mEB5n2z/0GFatCYzkI2f/nniWqVrBYjHkjsZy2EZioHu4wa99c1XEGJnFNDuNn6ESkfEyhyF4+OqKGnpK9HNrw7OWMuqn2oOh0iFd9fl6FTAm+Y0p3LP+38BuYzpCniqqdwIDAQABo0kwRzBFBgNVHQEEPjA8gBDvi8Rgio9v+mr58TiAvqF5oRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghAdEzTisaf2sEZxrqYZfYtCMAkGBSsOAwIdBQADgYEANdGlvHKeUptfNu9I0wgA5qjmVB+JDldOAkrfM0R+4IcVQ06y5K7P07uxQAV7+rhnDLgLyFJunUHgzbfjsjFy7vjwtoieXA5j0AYlm4AHR7dHt4HVgkIMYt8XOCqMw5jjFX91xJ89tC7mM9zYR48N9T5QSeMGo+f+JzybeLWxnNs=" />
-        </identity>
-      </endpoint>
-    </client>
-  </system.serviceModel>
+    <system.serviceModel>
+        <bindings>
+            <wsHttpBinding>
+                <binding name="WSHttpBinding_IAuthenticationService" closeTimeout="00:01:00"
+                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
+                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
+                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
+                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
+                    allowCookies="false">
+                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
+                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
+                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
+                        enabled="false" />
+                    <security mode="Message">
+                        <transport clientCredentialType="Windows" proxyCredentialType="None"
+                            realm="" />
+                        <message clientCredentialType="UserName" negotiateServiceCredential="true"
+                            algorithmSuite="Default" />
+                    </security>
+                </binding>
+            </wsHttpBinding>
+        </bindings>
+        <client>
+            <endpoint address="http://localhost:8732/Design_Time_Addresses/HeuristicLab.Services.Authentication/AuthenticationService"
+                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAuthenticationService"
+                contract="HeuristicLab.Services.Authentication.IAuthenticationService"
+                name="WSHttpBinding_IAuthenticationService">
+                <identity>
+                    <certificate encodedValue="AwAAAAEAAAAUAAAAAV7xMfFtgnY5+8sJyWRHHa0QvTcgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhBXQX+6QCO6m0LTqFCaKnh3MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMDkyNzE5MTIxNFoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDa4H45oXaRry7PwK3dI6AJWpxyEqmDBP+SnIZelLsPfWQ1oFPqH1zygaza0ZP+Gq5kxrL2cRrS9eiq/AlacWMOFsIEM6SZ/HBsaA9IiHssv3KH4uKwjcOWP1/TwL1OlwGDJszXrGmslrdFXg6I3grFlks8nYPVmuIzwVfmUKO+nwIDAQABo0kwRzBFBgNVHQEEPjA8gBDRH5aGMOUZ99XrCILH02uuoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghBXQX+6QCO6m0LTqFCaKnh3MAkGBSsOAwIdBQADgYEAtRZiYmZ7mKH0wkDd8v+33g8KU8mFiBS26hUowCpcCvYpG23FaVXbBua+zTt45RIBcEQUVdLOdtIAMogymV4sq9JafaU2Y9Dh9gnSqOF2KplC/xyf5f+QWwCZ4Yljr9g1BizWoOE6SF1TcjL66iZ09JMwYJKO9V3iuOosnzJ8DEA=" />
+                </identity>
+            </endpoint>
+        </client>
+    </system.serviceModel>
 </configuration>
