private static void Login() { if (loggedUser != null && clientAccount != null) { return; } Binding binding = new BasicHttpBinding(); EndpointAddress address = new EndpointAddress(ServerUrl); wsdl = new TaskDatabaseSoapClient(binding, address); string salt = wsdl.GetUserSalt(UserName); string hashedPasword = CreateHash1(Password, salt); string finalPassword = CreateHash2(hashedPasword, salt); loggedUser = wsdl.LoginUser2(UserName, finalPassword); clientAccount = wsdl.GetAccountForClient(loggedUser.InternalId, Guid.Parse(ClientRegistrationID)); }