public string GetToken(string login, string password) { AuthSoap.AuthInterface d = new AuthInterfaceClient(); AuthSoap.authRequest authRequest = new authRequest(); authRequest.login = login; authRequest.password = password; string token = String.Empty; try { AuthSoap.authResponse authResponse = d.auth(authRequest); return(authResponse.@return); } catch (Exception) { return(null); } }
public void step_01() { Logger.PrintHeadTest("[SOAP] Метод аутентификации [auth]"); Logger.PrintStepName("Step 1"); Logger.PrintAction("подключению к сервису", ""); AuthSoap.AuthInterface d = new AuthInterfaceClient(); AuthSoap.authRequest authRequest = new authRequest(); authRequest.login = login; authRequest.password = password; string token = String.Empty; try { AuthSoap.authResponse authResponse = d.auth(authRequest); token = ths.GetToken(login, password); Logger.PrintAction("Токен получен", token); } catch (Exception ex) { Assertion("Ошибка получения токена: " + ex.Message, Assert.Fail); } }