sanjayadvisie

Exception "Could not create a new package one step"

0 votes
Hi, I am getting the exception. Exception "Could not create a new package one step: Object reference not set to an instance of an object". I am on .NET version 4.7 and Newtonsoft 12. On debugging I can see that the error occurs in the call to ESLClient.CreatePackageOneStep(_vsdocpackage); Also this exception occurs only when the first call to ESLClient.CreatePackageOneStep(_vsdocpackage) is made. All subsequent calls to ESLClient.CreatePackageOneStep(_vsdocpackage) work fine. Note my ESLClient instance is not static and I am instantiating a new instance of ESL client for creating every package.

Reply to: Exception "Could not create a new package one step"

0 votes
Hi Thaban, Can you create the package with hardcoded information(with reading from XML)?
 EslClient eslClient = new EslClient(apiKey, apiUrl);
            DocumentPackage package = PackageBuilder
              .NewPackageNamed("Test Package .NET")
                    .WithSigner(SignerBuilder
                         .NewSignerWithEmail("[email protected]")
                                .WithFirstName("Signer First Name")
                                .WithLastName("Signer Last Name")
                                .WithCustomId("Signer"))
                    .WithDocument(DocumentBuilder.NewDocumentNamed("testpdf.pdf")
                                     .FromStream(File.OpenRead("your file path"), DocumentType.PDF)
                                  .WithId("testpdf.pdf")
                                  .WithSignature(SignatureBuilder
                                       .SignatureFor("[email protected]")
                                         .OnPage(0)
                                         .AtPosition(200, 300)
                                         .WithField(FieldBuilder.SignatureDate().OnPage(0).AtPosition(200, 400))
                                         )
                    )
                    .Build();

            PackageId pkgid = eslClient.CreatePackageOneStep(package);
Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Exception "Could not create a new package one step"

0 votes
No. I get the same error.

Reply to: Exception "Could not create a new package one step"

0 votes
Hi Thaban, How about the TLS version? OneSpan Sign has dropped support for TLS 1.0 so could that be an issue to you? What's your .Net version? Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Exception "Could not create a new package one step"

0 votes
Hi, I am running this on latest Windows 10 under .NET 4.5 project. I think the latest TLS is supported under this. Also, I am running the latest eSign SDK. I did have trouble using the Newtonsoft JSON that came with eSign SDK. I have to use the v11.00 which I downloaded from Newstonsoft website. Thaban

Reply to: Exception "Could not create a new package one step"

0 votes
Hi Thaban, Thanks for reporting the Newtonsoft version to us! It's a known issue already. And for the null pointer issue, can you try this function:
var appVersion = eslClient.SystemService.GetApplicationVersion();
This is the most basic function we suggest to use testing connection with OneSpan Sign, and if this works, it means your connection (proxy or tls related issue) with OSS is fine. And thanks again! Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Exception "Could not create a new package one step"

0 votes
Hi, I switched the project to NET 4.6 and this has resolved that issue. Could have been the TLS. Again, thanks for all your help. Thaban

Reply to: Exception "Could not create a new package one step"

0 votes
Glad to hear that! Just let us know if you have any other issues! Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Exception "Could not create a new package one step"

0 votes
Hi there, Below are some questions and thinking trying to understand the pattern of the issue: (1)Is it always the first call communicating to OneSpan Sign of the session or of the first start of the server/local code? What if you pre-invoked a dummy call like:
string applicationVersion = eslClient.SystemService.GetApplicationVersion();
(2)Can you try to connect to another network to see if it's a network problem? (3)Are you connecting through proxy? If that's the case, there was a post before indicating that this issue may be solved by introducing below configurations to the App.config:
Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


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