}
@Override
public org.jitterbit.integration.client.server.login.AuthenticateResult login(LoginCredentials credentials)
throws IntegrationServerException {
ServerAddress address = credentials.getServerAddress();
String userName = credentials.getUser();
String password = credentials.getPasswordHash();
String version = Versions.CURRENT.toString();
// Configure the web service.
AuthenticateServiceLocator locator = new AuthenticateServiceLocator();
// We cannot call getConfiguration().configureWebservice() here,
// because that would lead to infinite recursion since in order to configure
// a web service, you need to login. So we simply build the url ourselves:
StringBuilder url = credentials.isUsingHttps() ? new StringBuilder("https://") : new StringBuilder("http://");
url.append(address.toString()).append(getConfiguration().getWsPath()).append(SERVICE_NAME);
locator.setkonga_authenticateEndpointAddress(url.toString());
try {
WsKeyValuePairs keyValues = createKeyValuePairsToSendToServer();
AuthenticateResult ws_res = locator.getkonga_authenticate().loginWithVersionAndKeyValues(