Sudipta

Not able to get document after signing

0 votes
Hello I am not able to fetch the documents after signing a package. Following is the code I use to fetch and extract the documents for a signed package: import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import static org.springframework.util.StreamUtils.BUFFER_SIZE; . . . EslClient eslClient = new EslClient(apiKey, apiUrl); byte[] documentZip = eslClient.downloadZippedDocuments(packageId) inal List signedDocumentArray = new ArrayList(); try(ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(documentZip))){ ZipEntry entry; while((entry = zipInputStream.getNextEntry())!= null && !entry.isDirectory() && !entry.getName().contains(CONSENT_FORM_NAME)){ byte[] fileBytes = new byte[BUFFER_SIZE]; if (zipInputStream.read(fileBytes) > 0) { signedDocumentArray.add(Base64.getEncoder().withoutPadding().encodeToString(fileBytes)); }else { throw new BusinessException(ErrorCode.VENDOR_DOCUMENT_COULD_NOT_BE_PARSED.value()); } zipInputStream.closeEntry(); } } if(signedDocumentArray.isEmpty()) { // throw error } Before fetching the document, we check the status of the package using the following SDK method: eslClient.getSigningStatus(packageId, null, null); The status that we get is 'COMPLETE' which I am assuming means document is signed. Can somebody help me resolve this issue? -Sudipta

Reply to: Not able to get document after signing

0 votes
Hey Sudipta, Have a look at our quick start guide on how to download signed documents: https://developer.esignlive.com/guides/quick-start/check-package-status-and-download-documents-java/. Let me know if this works for you.
Haris Haidary OneSpan Technical Consultant

Reply to: Not able to get document after signing

0 votes
Thanks Haris the quick turnaround. I am able to download the signed documents on disk with the code sample that you shared. But I needed to extract the files inside the zip in memory as we have a subsequent workflow which needs the documents in memory. But I believe, w.r.t. eSignLive, the document zip with the signed files is being returned successfully. So, the problem is not at your end for sure. Thanks for all the help. I need to find out the issue in the code we are using to extract the files. Thanks again. Regards Sudipta

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off