package com.kofax.kmc.klo.logistics.webservice.calls; import com.kofax.kmc.klo.logistics.webservice.KofaxWebServiceResponseBase; import com.kofax.kmc.klo.logistics.webservice.RetrieveScanSettingsResponse; import com.kofax.kmc.klo.logistics.webservice.WebServiceCallResult; import com.kofax.kmc.klo.logistics.webservice.WscDestination; import com.kofax.kmc.klo.logistics.webservice.WscRetrieveScanSettingsRequest; import com.kofax.kmc.kut.utilities.CertificateValidatorListener; import com.kofax.kmc.kut.utilities.error.ErrorInfo; import com.kofax.mobile.sdk._internal.k; import java.net.SocketTimeoutException; import java.net.URL; import javax.net.ssl.SSLException; import o.C15281gmQ; import o.gjJ; import o.gmO; /* loaded from: classes3.dex */ public class RetrieveScanSettings extends KofaxWebServiceCallBase { public static String METHOD_NAME = "getScanSettings"; public static String NAMESPACE = "http://scansettings.wsc.des.kofax.com"; public static String SERVICE_NAME = "RetrieveScanSettingsService"; public static String SOAP_ACTION = "urn:getScanSettings"; private static final String TAG = "RetrieveScanSettings"; private WscRetrieveScanSettingsRequest request = null; public WebServiceCallResult init(URL url, WscDestination wscDestination, CertificateValidatorListener certificateValidatorListener) { WebServiceCallResult init = super.init(url, certificateValidatorListener); if (!init.isSuccess()) { return init; } setRequest(WscRetrieveScanSettingsRequest.initializeRequest(wscDestination, this.kfsUsername, this.kfsPassword)); return init; } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public gmO packageRequest() { gmO gmo = new gmO(getNamespace(), getMethodName()); gmO gmo2 = new gmO(NAMESPACE, "wscRequest"); gmo2.b.addElement(createPropertyInfo("http://wsc.des.kofax.com/xsd", "password", this.request.getPassword(), C15281gmQ.j)); gmo2.b.addElement(createPropertyInfo("http://wsc.des.kofax.com/xsd", "userName", this.request.getUserName(), C15281gmQ.j)); gmo2.b.addElement(createPropertyInfo("http://wsc.des.kofax.com/xsd", "wscClientId", this.request.getWscClientId(), C15281gmQ.j)); gmo2.b.addElement(createPropertyInfo("http://scansettings.wsc.des.kofax.com/xsd", "shortcutName", this.request.getShortcutName(), C15281gmQ.j)); gmo2.b.addElement(createPropertyInfo("http://scansettings.wsc.des.kofax.com/xsd", "shortcutTypeOrdinal", this.request.getShortcutTypeOrdinal(), C15281gmQ.j)); gmo.b.addElement(gmo2); return gmo; } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public KofaxWebServiceResponseBase populateFromResponse(gmO gmo) { return RetrieveScanSettingsResponse.populateFromResponse(gmo); } public static WebServiceCallResult getScanSettings(URL url, WscDestination wscDestination, String str, String str2, CertificateValidatorListener certificateValidatorListener, int i) { k.c(TAG, "getScanSettings"); RetrieveScanSettings retrieveScanSettings = new RetrieveScanSettings(); retrieveScanSettings.setkfsPassword(str2); retrieveScanSettings.setkfsUsername(str); retrieveScanSettings.setTimeout(i); WebServiceCallResult init = retrieveScanSettings.init(url, wscDestination, certificateValidatorListener); init.setSuccess(false); try { RetrieveScanSettingsResponse retrieveScanSettingsResponse = (RetrieveScanSettingsResponse) retrieveScanSettings.execute(); if (!gjJ.b((CharSequence) retrieveScanSettingsResponse.getErrorMessage())) { init.setErrorMsg(retrieveScanSettingsResponse.getErrorMessage()); init.setSuccess(false); } else { init.setExtraData(retrieveScanSettingsResponse); init.setSuccess(true); } } catch (SocketTimeoutException e) { k.e(TAG, "retrieve scan settings service SocketTimeoutException", (Throwable) e); init.setErrorMsg(e.getMessage()); init.setErrorInfo(ErrorInfo.KMC_LO_REQUEST_TIMEOUT); } catch (SSLException e2) { k.e(TAG, "Error in scan settings", (Throwable) e2); init.setErrorMsg(e2.getMessage()); init.setCertificateError(true); } catch (Exception unused) { init.setErrorMsg("Unknown error"); } return init; } public void setRequest(WscRetrieveScanSettingsRequest wscRetrieveScanSettingsRequest) { this.request = wscRetrieveScanSettingsRequest; } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public String getSoapAction() { return SOAP_ACTION; } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public String getServiceName() { return SERVICE_NAME; } public WscRetrieveScanSettingsRequest getRequest() { return this.request; } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public String getNamespace() { return NAMESPACE; } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public String getMethodName() { return METHOD_NAME; } }