what-the-bank/sources/com/kofax/kmc/klo/logistics/webservice/calls/StartJob.java

119 lines
5.0 KiB
Java

package com.kofax.kmc.klo.logistics.webservice.calls;
import com.kofax.kmc.klo.logistics.webservice.KofaxWebServiceResponseBase;
import com.kofax.kmc.klo.logistics.webservice.StartJobResponse;
import com.kofax.kmc.klo.logistics.webservice.WebServiceCallResult;
import com.kofax.kmc.klo.logistics.webservice.WscRequest;
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 java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import javax.net.ssl.SSLException;
import o.C15281gmQ;
import o.gmO;
/* loaded from: classes3.dex */
public class StartJob extends KofaxWebServiceCallBase {
public static String METHOD_NAME = "startJob";
public static String NAMESPACE = "http://job.wsc.des.kofax.com";
public static List<String> PARAM_FIELD_NAMES = new ArrayList();
public static String SERVICE_NAME = "StartJobService";
public static String SOAP_ACTION = "urn:startJob";
private static final String TAG = "StartJob";
private WscRequest request = null;
public WebServiceCallResult init(URL url, String str, String str2, CertificateValidatorListener certificateValidatorListener) {
WebServiceCallResult init = super.init(url, certificateValidatorListener);
if (!init.isSuccess()) {
return init;
}
WscRequest initializeRequest = WscRequest.initializeRequest();
initializeRequest.setJobId(UUID.randomUUID().toString().toUpperCase());
initializeRequest.setUserName(str);
initializeRequest.setPassword(str2);
setRequest(initializeRequest);
return init;
}
@Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase
public KofaxWebServiceResponseBase populateFromResponse(gmO gmo) {
return StartJobResponse.populateFromResponse(gmo);
}
@Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase
public gmO packageRequest() {
gmO gmo = new gmO(getNamespace(), getMethodName());
gmO gmo2 = new gmO(NAMESPACE, "wsRequest");
gmo2.b.addElement(createPropertyInfo("http://wsc.des.kofax.com/xsd", "jobId", this.request.getJobId(), C15281gmQ.j));
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));
gmo.b.addElement(gmo2);
return gmo;
}
public static WebServiceCallResult startJob(URL url, String str, String str2, CertificateValidatorListener certificateValidatorListener, int i) {
new WebServiceCallResult().setSuccess(false);
StartJob startJob = new StartJob();
startJob.setTimeout(i);
WebServiceCallResult init = startJob.init(url, str, str2, certificateValidatorListener);
if (init.isSuccess()) {
init.setSuccess(false);
try {
StartJobResponse startJobResponse = (StartJobResponse) startJob.execute();
if (startJobResponse.getResultCode() != 0) {
init.setErrorMsg(startJobResponse.getErrorMessage());
init.setSuccess(false);
} else {
init.setExtraData(startJobResponse);
init.setSuccess(true);
}
} catch (SocketTimeoutException e) {
k.e(TAG, "start job service SocketTimeoutException", (Throwable) e);
init.setErrorMsg(e.getMessage());
init.setErrorInfo(ErrorInfo.KMC_LO_REQUEST_TIMEOUT);
} catch (SSLException e2) {
k.e(TAG, "Error in start job", (Throwable) e2);
init.setErrorMsg(e2.getMessage());
init.setCertificateError(true);
} catch (Exception e3) {
k.e(TAG, "Unable to start job : ", (Throwable) e3);
init.setErrorMsg("Unknown error");
}
}
return init;
}
public void setRequest(WscRequest wscRequest) {
this.request = wscRequest;
}
@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 WscRequest 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;
}
}