kabelo

Simple Create And Send Package: Could not upload document to package Exception

0 votes
Hi all. Help with the following really appreciated. Below code produces exception: "code":500,"name":"Unhandled Server Error". This exception occurs when uploading PDF with form inputs. Flat PDF (no form inputs) works fine. PDF form attached. Working through tutorial at https://www.esignlive.com/blog/e-signlive-for-new-users-how-to-create-and-send-your-first-package-java-sdk/
package com.eightbitplatoon.esl.demo;

import static com.silanis.esl.sdk.builder.DocumentBuilder.newDocumentWithName;
import static com.silanis.esl.sdk.builder.PackageBuilder.newPackageNamed;
import static com.silanis.esl.sdk.builder.SignatureBuilder.signatureFor;
import static com.silanis.esl.sdk.builder.SignerBuilder.newSignerWithEmail;

import com.silanis.esl.sdk.DocumentPackage;
import com.silanis.esl.sdk.EslClient;
import com.silanis.esl.sdk.PackageId;

public class SimpleCreateAndSendPackage {

	public static final String API_KEY = "xxxxx==";
	public static final String API_URL = "https://sandbox.esignlive.com/api";

	public static void main(String[] args) {
		EslClient eslClient = new EslClient(API_KEY, API_URL);
		// Build the DocumentPackage object
		DocumentPackage documentPackage = newPackageNamed("ESL Demo Package API")
				.withSigner(newSignerWithEmail("[email protected]").withCustomId("david").withFirstName("David")
						.withLastName("Jones"))
				.withSigner(newSignerWithEmail("[email protected]").withFirstName("James").withLastName("Jackson"))
				.withDocument(newDocumentWithName("eSignDemo").fromFile("eSignDemo.pdf")
						.withSignature(signatureFor("[email protected]").onPage(0).atPosition(175, 165))
						.withSignature(signatureFor("[email protected]").onPage(0).atPosition(550, 165)))
				.build();

		// Issue the request to the e-SignLive server to create the
		// DocumentPackage
		PackageId packageId = eslClient.createPackage(documentPackage);

		// Send the package to be signed by the participants
		eslClient.sendPackage(packageId);
	}
}
Exception in thread "main" com.silanis.esl.sdk.internal.EslServerException: Could not upload document to package. Exception: HTTP POST on URI https://sandbox.esignlive.com/api/packages/GHINncVG9A9ciK5WMGOBXyfp7JU=/documents resulted in response with status code: [500, Internal Server Error]. Optional details: {"messageKey":"error.internal.default","technical":"error.eslx.inputValidation.documentPreverifyError [#84f08b39-aca6-4bdf-97d3-421078ddd66b]","message":"Unexpected Error. Our technical staff have been notified and will look into the problem. We apologize for any inconvenience this may have caused you.","code":500,"name":"Unhandled Server Error"} at com.silanis.esl.sdk.service.PackageService.uploadApiDocument(PackageService.java:255) at com.silanis.esl.sdk.service.PackageService.uploadDocument(PackageService.java:240) at com.silanis.esl.sdk.EslClient.uploadDocument(EslClient.java:556) at com.silanis.esl.sdk.EslClient.uploadDocument(EslClient.java:560) at com.silanis.esl.sdk.EslClient.createPackage(EslClient.java:235) at com.eightbitplatoon.esl.demo.SimpleCreateAndSendPackage.main(SimpleCreateAndSendPackage.java:31) Caused by: com.silanis.esl.sdk.internal.RequestException: HTTP POST on URI https://sandbox.esignlive.com/api/packages/GHINncVG9A9ciK5WMGOBXyfp7JU=/documents resulted in response with status code: [500, Internal Server Error]. Optional details: {"messageKey":"error.internal.default","technical":"error.eslx.inputValidation.documentPreverifyError [#84f08b39-aca6-4bdf-97d3-421078ddd66b]","message":"Unexpected Error. Our technical staff have been notified and will look into the problem. We apologize for any inconvenience this may have caused you.","code":500,"name":"Unhandled Server Error"} at com.silanis.esl.sdk.internal.RestClient.execute(RestClient.java:195) at com.silanis.esl.sdk.internal.RestClient.postMultipartFile(RestClient.java:132) at com.silanis.esl.sdk.service.PackageService.uploadApiDocument(PackageService.java:251) ... 5 more

Attachments

Reply to: Simple Create And Send Package: Could not upload document to package Exception

0 votes
Hey, Looking at your document, it seems that there are some restrictions on it. Namely changing the document and document assembly is not allowed. Can you try removing those restrictions and see if it works?
Haris Haidary OneSpan Technical Consultant

Attachments

Reply to: Simple Create And Send Package: Could not upload document to package Exception

0 votes
Hi Haris Appreciate the help. Used LiveCycle to create the PDF. I don't see how to change these properties within LiveCycle. Googling results, so far, lead me to believe it isn't possible (within LiveCycle or Acrobat). Currently investigating other tools for creating PDF forms.

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