package com.kofax.kmc.klo.logistics.webservice.calls; import com.kofax.kmc.klo.logistics.webservice.GetIndexFieldsResponse; import com.kofax.kmc.klo.logistics.webservice.KofaxWebServiceResponseBase; import com.kofax.kmc.klo.logistics.webservice.WebServiceCallResult; import com.kofax.kmc.klo.logistics.webservice.WscDestination; import com.kofax.kmc.klo.logistics.webservice.WscIndexFieldsRequest; 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 GetIndexFields extends KofaxWebServiceCallBase { public static String METHOD_NAME = "getIndexFields"; public static String NAMESPACE = "http://indexfields.wsc.des.kofax.com"; public static String SERVICE_NAME = "GetIndexFieldsService"; public static String SOAP_ACTION = "urn:getIndexFields"; private static final String TAG = "GetIndexFields"; private WscIndexFieldsRequest fieldRequest = null; public WebServiceCallResult init(URL url, WscDestination wscDestination, CertificateValidatorListener certificateValidatorListener) { WebServiceCallResult init = super.init(url, certificateValidatorListener); if (!init.isSuccess()) { return init; } setFieldRequest(WscIndexFieldsRequest.initializeRequest(wscDestination, this.kfsUsername, this.kfsPassword)); return init; } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public KofaxWebServiceResponseBase populateFromResponse(gmO gmo) { return GetIndexFieldsResponse.populateFromResponse(gmo); } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase protected gmO packageRequest() { gmO gmo = new gmO(getNamespace(), getMethodName()); gmO gmo2 = new gmO(NAMESPACE, "wsRequest"); gmo2.b.addElement(createPropertyInfo("http://wsc.des.kofax.com/xsd", "password", this.fieldRequest.getPassword(), C15281gmQ.j)); gmo2.b.addElement(createPropertyInfo("http://wsc.des.kofax.com/xsd", "userName", this.fieldRequest.getUserName(), C15281gmQ.j)); gmo2.b.addElement(createPropertyInfo("http://wsc.des.kofax.com/xsd", "wscClientId", this.fieldRequest.getWscClientId(), C15281gmQ.j)); gmo2.b.addElement(createPropertyInfo("http://indexfields.wsc.des.kofax.com/xsd", "backendId", this.fieldRequest.getBackendId(), C15281gmQ.j)); gmo2.b.addElement(createPropertyInfo("http://indexfields.wsc.des.kofax.com/xsd", "dataStoreName", this.fieldRequest.getDataStoreName(), C15281gmQ.j)); gmo2.b.addElement(createPropertyInfo("http://indexfields.wsc.des.kofax.com/xsd", "formTypeId", this.fieldRequest.getFormTypeId(), C15281gmQ.j)); gmo2.b.addElement(createPropertyInfo("http://indexfields.wsc.des.kofax.com/xsd", "shortcutName", this.fieldRequest.getShortcutName(), C15281gmQ.j)); gmo2.b.addElement(createPropertyInfo("http://indexfields.wsc.des.kofax.com/xsd", "shortcutTypeOrdinal", Integer.valueOf(this.fieldRequest.getShortcutTypeOrdinal()), C15281gmQ.c)); gmo.b.addElement(gmo2); return gmo; } public static WebServiceCallResult getIndexFields(URL url, WscDestination wscDestination, String str, String str2, CertificateValidatorListener certificateValidatorListener, int i) { GetIndexFields getIndexFields = new GetIndexFields(); getIndexFields.setkfsUsername(str); getIndexFields.setkfsPassword(str2); getIndexFields.setTimeout(i); WebServiceCallResult init = getIndexFields.init(url, wscDestination, certificateValidatorListener); if (init.isSuccess()) { init.setSuccess(false); try { GetIndexFieldsResponse getIndexFieldsResponse = (GetIndexFieldsResponse) getIndexFields.execute(); if (!gjJ.b((CharSequence) getIndexFieldsResponse.getErrorMessage())) { init.setErrorMsg(getIndexFieldsResponse.getErrorMessage()); init.setSuccess(false); } else { init.setExtraData(getIndexFieldsResponse); init.setSuccess(true); } } catch (SocketTimeoutException e) { k.e(TAG, "get index fields service SocketTimeoutException", (Throwable) e); init.setErrorMsg(e.getMessage()); init.setErrorInfo(ErrorInfo.KMC_LO_REQUEST_TIMEOUT); } catch (SSLException e2) { k.e(TAG, "Error in get index fields", (Throwable) e2); init.setErrorMsg(e2.getMessage()); init.setCertificateError(true); } catch (Exception e3) { String name = getIndexFields.getClass().getName(); StringBuilder sb = new StringBuilder("Unable to get index fields for shorcut "); sb.append(wscDestination.getDisplayValue()); k.e(name, sb.toString(), (Throwable) e3); init.setErrorMsg("Unknown error"); } } return init; } @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; } @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; } public WscIndexFieldsRequest getFieldRequest() { return this.fieldRequest; } private void setFieldRequest(WscIndexFieldsRequest wscIndexFieldsRequest) { this.fieldRequest = wscIndexFieldsRequest; } }