package com.kofax.kmc.klo.logistics.webservice.calls; import com.kofax.kmc.klo.logistics.service.NetworkService; import com.kofax.kmc.klo.logistics.webservice.DeviceProfileResponse; import com.kofax.kmc.klo.logistics.webservice.KofaxWebServiceResponseBase; import com.kofax.kmc.klo.logistics.webservice.WebServiceCallResult; import com.kofax.kmc.klo.logistics.webservice.WscProfileRequest; 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 ProfileService extends KofaxWebServiceCallBase { public static String METHOD_NAME = "getProfile"; public static String NAMESPACE = "http://profile.wsc.des.kofax.com"; public static String SERVICE_NAME = "ProfileService"; public static String SOAP_ACTION = "urn:getProfile"; private static String TAG = "ProfileService"; private WscProfileRequest profleRequest = null; @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public WebServiceCallResult init(URL url, CertificateValidatorListener certificateValidatorListener) { WebServiceCallResult init = super.init(url, certificateValidatorListener); k.c(TAG, "result = ".concat(String.valueOf(init))); if (!init.isSuccess()) { return init; } setProfileRequest(WscProfileRequest.initializeRequest(NetworkService.getMacAddress())); init.setSuccess(gjJ.b((CharSequence) init.getErrorMsg())); k.c(TAG, "result = ".concat(String.valueOf(init))); return init; } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public KofaxWebServiceResponseBase populateFromResponse(gmO gmo) { return DeviceProfileResponse.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://profile.wsc.des.kofax.com/xsd", "wscClientId", this.profleRequest.getWscClientId(), C15281gmQ.j)); gmo.b.addElement(gmo2); return gmo; } public static WebServiceCallResult getProfile(URL url, int i, CertificateValidatorListener certificateValidatorListener) { ProfileService profileService = new ProfileService(); profileService.setTimeout(i); WebServiceCallResult init = profileService.init(url, certificateValidatorListener); if (init.isSuccess()) { init.setSuccess(false); try { DeviceProfileResponse deviceProfileResponse = (DeviceProfileResponse) profileService.execute(); if (!gjJ.b((CharSequence) deviceProfileResponse.getErrorMessage())) { init.setErrorMsg(deviceProfileResponse.getErrorMessage()); init.setSuccess(false); } else { init.setExtraData(deviceProfileResponse); init.setSuccess(true); } } catch (SocketTimeoutException e) { k.e(TAG, "Profile Service SocketTimeoutException", (Throwable) e); init.setErrorMsg(e.getMessage()); init.setErrorInfo(ErrorInfo.KMC_LO_REQUEST_TIMEOUT); } catch (SSLException e2) { k.e(TAG, "Error in get profile", (Throwable) e2); init.setErrorMsg(e2.getMessage()); init.setCertificateError(true); } catch (Exception e3) { k.e(profileService.getClass().getName(), "Unable to get profile documents", (Throwable) e3); init.setErrorMsg("Unknown error"); } } String str = TAG; StringBuilder sb = new StringBuilder("result from get profile = "); sb.append(init.getErrorMsg()); sb.append(" "); sb.append(init.getExtraData()); k.c(str, sb.toString()); 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; } public WscProfileRequest getProfileRequest() { return this.profleRequest; } @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; } private void setProfileRequest(WscProfileRequest wscProfileRequest) { this.profleRequest = wscProfileRequest; } }