kang666 | Posts: 7

Session token on NEW INSTANCE/UI is poining to OLD UI

0 votes
Hi, i have a problem when trying to generate a URL with sender authentication token to package view. When i do that on old-instance (sandbox.e-signlive.ca) its working fine. But when i do that on new-instance(sandbox.esignlive.com) its not working fine reps the UI looks the old way. Is there a way how to do this for NEW UI ? to generate an URL to package or designer view with sender authentication token? Do i need to use newer version of SDK or use some parameter when generating it (which i did not find in the source code)? We are using SDK version 11.0 Here is the code to generate the token:
private String getRedirectToPackageViewForSender(EslClient eslClient, AuthenticationClient authenticationClient, PackageId packageId) {
	final String senderAuthenticationToken = eslClient.getAuthenticationTokensService().createSenderAuthenticationToken(packageId.getId());
	String redirectToPackageViewForSender = authenticationClient.buildRedirectToPackageViewForSender(senderAuthenticationToken, packageId.getId());
	return redirectToPackageViewForSender;
}
So the generated URL is for example is for OLD UI - Canada instance: https://sandbox.e-signlive.ca/auth?authenticationToken=NzNlMDllODEtYTFkNy00YzE1LWFmZjYtMTRhYTZiOWIxN2Uy&target=https%3A%2F%2Fsandbox.e-signlive.ca%2Fpackages%2Fab1059a6-cbf5-4552-92ec-6516bcec6d73 and when i login to OLD UI the URLs are :
https://sandbox.e-signlive.ca/packages/drafts
https://sandbox.e-signlive.ca/packages/ab1059a6-cbf5-4552-92ec-6516bcec6d73
https://sandbox.e-signlive.ca/packages/ab1059a6-cbf5-4552-92ec-6516bcec6d73/documents/e7c1322c9ff76479
etc. The thing is when i switch to new instance -> https://sandbox.esignlive.com Then build the package there with the same code (just EslClient is configured to use this new API key and Url) Then the generated URL is still the same: https://sandbox.esignlive.com/auth?authenticationToken=N2JkZTEyMzItYmUzMS00ODUwLWI0YWMtNmI4N2NjZWJkOTkw&target=https%3A%2F%2Fsandbox.esignlive.com%2Fpackages%2Fbzj5ef0fi6O0-t19Zb4UYLu7bRE%3D !!! When i open the overlay it is opened as old UI !!!! BUT!!! When i login to Web UI and look into the url for example for the package view or the document view it has /a/ in URL which old instance does not have (and in fact the URLs are different, there is /a/transaction/{pacakgeId} )
https://sandbox.esignlive.com/a/dashboard
https://sandbox.esignlive.com/a/transaction/FgymOlo51cK9ZN-EG4RY-cHSxUs=
https://sandbox.esignlive.com/a/transaction/GpjvMV2aIVfx8CI1i-dm63UVjCU=/design
etc. I looked into source code in UrlTemplate.java and there is no mention about "/a/" etc which is used as URL for new UI. The second thing is that i cannot upload the document to package when using new INSTANCE: The code fails on call: eslClient.uploadDocument(document, documentPackage);
com.silanis.esl.sdk.EslException: Could not upload document to package.
	at com.silanis.esl.sdk.service.PackageService.uploadApiDocument(PackageService.java:257)
	at com.silanis.esl.sdk.service.PackageService.uploadDocument(PackageService.java:240)
Any known issues with that? Probably the URL/REST call is different on new instance so thats why the call fails...

harishaidary | Posts: 1812

Reply to: Session token on NEW INSTANCE/UI is poining to OLD UI

0 votes
Hi, Yes, our product management team is aware of the issue for the buildRedirectToPackageViewForSender() and buildRedirectToDesignerForSender() methods pointing to the classic ui "look". They are currently working on a fix. For now, to get the new designer, you will to create a senderAuthenticationToken and build manually the following url: "https://sandbox.esignlive.com/auth?authenticationToken={senderToken}&target=https://sandbox.esignlive.com/a/transaction/{packageId}/designer" (for designer) "https://sandbox.esignlive.com/auth?authenticationToken={senderToken}&target=https://sandbox.esignlive.com/a/transaction/{packageId}" (for package view) For the document upload failing, could you provide more details please?
  • does it occur for a specific document or all documents
  • does it return more than just "Could not upload document to package" (i.e. a reason why the upload failed)
  • do you have the correct api key?

kang666 | Posts: 7

Reply to: Session token on NEW INSTANCE/UI is poining to OLD UI

0 votes
Thanks for info about the URL issue. Regarding the document upload issue i found that it is document related. For testing i am using documents from source file jar http://docs.e-signlive.com/11.0/sdk/esl-sdk-java-11.0.zip document-with-fields.pdf causing this error extract_document.pdf failing too document.pdf is working fine document-for-anchor-extraction.pdf fine document.odt fine field_groups.pdf fine AND what's more the signer of the package must be added after package is created: here is complete code to reproduce the problem:
	@Test
	public void testDocumentPackageSettings() {
		System.out.println("== testDocumentPackageSettings ==");
		
		String DECLINE_REASON_1 = "Decline reason One";
		String DECLINE_REASON_2 = "Decline reason Two";
		String DECLINE_REASON_3 = "Decline reason Three";
		String OPT_OUT_REASON_1 = "Opt out reason One";
		String OPT_OUT_REASON_2 = "Opt out reason Two";
		String OPT_OUT_REASON_3 = "Opt out reason Three";
		String HAND_OVER_LINK_HREF = "http://www.google.ca";
		String HAND_OVER_LINK_TEXT = "click here";
		String HAND_OVER_LINK_TOOLTIP = "link tooltip";
		
		DocumentPackage superDuperPackage = 
			PackageBuilder.newPackageNamed( "Custom " + new SimpleDateFormat( "HH:mm:ss" ).format( new Date() ) )
				.withSettings( DocumentPackageSettingsBuilder.newDocumentPackageSettings()
						.withInPerson()
						.withoutLanguageDropDown()
						.hideOwnerInPersonDropDown()
						.disableFirstAffidavit()
						.disableSecondAffidavit()
						.withDecline()
						.withDeclineReason(DECLINE_REASON_1)
						.withDeclineReason(DECLINE_REASON_2)
						.withDeclineReason(DECLINE_REASON_3)
						.withOptOut()
						.withOptOutReason(OPT_OUT_REASON_1)
						.withOptOutReason(OPT_OUT_REASON_2)
						.withOptOutReason(OPT_OUT_REASON_3)
						.withHandOverLinkHref(HAND_OVER_LINK_HREF)
						.withHandOverLinkText(HAND_OVER_LINK_TEXT)
						.withHandOverLinkTooltip(HAND_OVER_LINK_TOOLTIP)
						.withDialogOnComplete()
				
						.withCeremonyLayoutSettings( 
							CeremonyLayoutSettingsBuilder.newCeremonyLayoutSettings()
								.withoutGlobalConfirmButton()
								.withoutGlobalSaveAsLayoutButton()
						)
				)
		.build();
		
		PackageId myPackageId = eslClient.createPackage( superDuperPackage );
		System.out.println("myPackageId: " + myPackageId);
		
		Signer signer = SignerBuilder.newSignerWithEmail(SIGNER_FRST_EMAIL)
			.withFirstName(SIGNER_FRST_FIRST_NAME)
			.withLastName(SIGNER_FRST_LAST_NAME)
		.build();
		
		superDuperPackage = eslClient.getPackage(myPackageId);
		eslClient.getPackageService().addSigner(superDuperPackage.getId(), signer);
		
		Document document = DocumentBuilder.newDocumentWithName("DOCUMENT_SETUP_NAME")
			.withDescription("TEST_DOC_FILE_NAME_DOC_PDF_STREAM")
			.fromStream( loadDocumentInputStream("document-with-fields.pdf"), DocumentType.PDF )
		.build();
		
		superDuperPackage = eslClient.getPackage(myPackageId);
		//Add document to the existing package
		document = eslClient.uploadDocument(document, superDuperPackage);
		
		System.out.println("== testDocumentPackageSettings PASSED ==");
	}
Then failing line is in SignatureConverter.toSDKSignature:66 signatureBuilder is null NOTE: on the OLD instance its working fine Here is the full trace:
com.silanis.esl.sdk.EslException: Could not upload document to package.
	at com.silanis.esl.sdk.service.PackageService.uploadApiDocument(PackageService.java:257)
	at com.silanis.esl.sdk.service.PackageService.uploadDocument(PackageService.java:240)
	at com.silanis.esl.sdk.EslClient.uploadDocument(EslClient.java:564)
	at com.silanis.esl.sdk.EslClient.uploadDocument(EslClient.java:568)
	at com.ibm.pgms.esign.PackagesServiceSDKTest.testDocumentPackageSettings(PackagesServiceSDKTest.java:533)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:611)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.NullPointerException
	at com.silanis.esl.sdk.internal.converter.SignatureConverter.toSDKSignature(SignatureConverter.java:66)
	at com.silanis.esl.sdk.internal.converter.DocumentConverter.toSDKDocument(DocumentConverter.java:63)
	at com.silanis.esl.sdk.service.PackageService.uploadApiDocument(PackageService.java:253)
	... 26 more

harishaidary | Posts: 1812

Reply to: Session token on NEW INSTANCE/UI is poining to OLD UI

0 votes
Would you able to share your document so I can reproduce on my side? If so, please make sure to remove any sensitive data from the document, if any.

kang666 | Posts: 7

Reply to: Session token on NEW INSTANCE/UI is poining to OLD UI

0 votes
sure as i said i am using document which are freely available in the source JAR file from that link *(just unzip the jar), i will attach 1 document which is failing when trying to execute code i mentioned in my previous post

Attachments
harishaidary | Posts: 1812

Reply to: Session token on NEW INSTANCE/UI is poining to OLD UI

0 votes
i don't see any documents included in the zip file you mentioned. Anyhow, that document above seems like a test document. I'm pretty sure you're not going using that document in future real transactions. From a code standpoint, I don't see anything wrong there. So, once you have your final document(s) ready, there shouldn't be any issues. If you do, let me know.
AND what’s more the signer of the package must be added after package is created:
Technically yes. But if you meant in terms of code, you can define your signer in your DocumentPackage object like so:
		DocumentPackage pack = PackageBuilder.newPackageNamed("Testing in Person!")
				.withSigner(SignerBuilder.newSignerWithEmail("[email protected]")
						.withFirstName("John")
						.withLastName("Smith")
						.withCustomId("signer1"))
				.withSigner(SignerBuilder.newSignerWithEmail("[email protected]")
						.withFirstName("Mary")
						.withLastName("Doe")
						.withCustomId("signer2"))
				.withDocument(DocumentBuilder.newDocumentWithName("some doc")
						.fromFile("C:/Users/hhaidary/Desktop/PDFs/doc1.pdf")
						.withSignature(SignatureBuilder.captureFor("[email protected]")
								.atPosition(100, 100)
								.onPage(0))
				.withSignature(SignatureBuilder.signatureFor("[email protected]")
						.atPosition(200, 200)
						.onPage(0)))
				.build();
		
		PackageId packageId = eslClient.createPackage(pack);

kang666 | Posts: 7

Reply to: Session token on NEW INSTANCE/UI is poining to OLD UI

0 votes
yes, its test document, but if that error happens in 2 test documents it means that it can happens even on real one. The code i posted is from syntactic point of view correct and in fact 100% working fine on OLD instance (for every tested document) What i am trying to say that on NEW instance there could be possible error for this "setup". BUT - If you execute that code i've posted it ends with an error. At least on my SDK v11.0 And ofc the code you've posted is correct but still it's a workaround and i would like to be able to add documents and signers to package which already exists. i am attaching also second document which is causing this error.

Attachments
harishaidary | Posts: 1812

Reply to: Session token on NEW INSTANCE/UI is poining to OLD UI

0 votes
The reason why those two documents failed to upload because it contained form fields with incorrect naming convention. You would typically use form fields if you're looking to use the document extraction feature in eSignLive (http://docs.esignlive.com/content/c_integrator_s_guide/sdk/c_managing_documents/extraction.htm). I assumed from your code that this isn't the case since I didn't see the "enableExtraction()" method. Now, you have two options to make the document upload work with those two documents:
  1. Delete all the form fields from the pdf.
  2. Rename all the form fields as per the esignlive convention and use the document extraction feature
Here's an example of a test I ran with the document you provided using document extraction: a Attached is the document you provided with proper naming convention. Hope this clears things up :)

Attachments

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