Not able to get document after signing
Wednesday, January 31, 2018 at 12:42pmHello
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
Thursday, February 1, 2018 at 04:14amReply to: Not able to get document after signing
Thursday, February 1, 2018 at 07:39am