Account


Earned badges

Achievement: Latest Unlocked

Topic Started

Topics
Hello, I recently updated the api version for Silanis.ESL.dll from 10.3 to 10.13, after doing so the code that I'm using to dynamically build the packages for getting signed no longer works.

Replies Created

0 votes
Good idea on commenting out various chunks of code. I was under the impression that leaving any of those bits out would automatically generate an error on CreatePackage(), however the required parts are only actually required during SendPackage(), I still would get errors, but easily understood errors that happened a line later... Anyways, I was able to narrow it down to being an issue with the Signer (leaving signer in the package would always fail at CreatePackage, removing it would then error during SendPackage), which is generated with the following code:
    Private Function createSignerDynamic(cEmail As String, cFirst As String, cLast As String, cCompany As String, cID As String) As Signer
        Dim s As Signer

        s = SignerBuilder.NewSignerWithEmail(cEmail) _
            .WithFirstName(cFirst) _
            .WithLastName(cLast) _
            .Build()

        'We do not want to have any emails going out to the users
        s.DeliverSignedDocumentsByEmail = False

        If Not String.IsNullOrEmpty(cCompany) Then
            s.Company = cCompany
        End If
        If Not String.IsNullOrEmpty(cID) Then
            s.Id = cID
        End If

        Return s
    End Function
Now I'll begin looking into what changes might have been made that cause this code to no longer work...

0 votes

Ok, after more trial and error using the same technique, I narrowed it down to the following bit of code inside createSignerDynamic:

        If Not String.IsNullOrEmpty(cID) Then
            s.Id = cID
        End If

I was passing in eSignUser.ID with the value of their email address as I didn't have anything else to use for the signer.Id value. After commenting out this code it was now erroring at:

        Dim sessionToken As SessionToken = eslClient.SessionService.CreateSessionToken(packageId, signer.Id)

Which was being caused by signer.Id being Nothing, so I changed that line to the following

        Dim sessionToken As SessionToken = eslClient.SessionService.CreateSessionToken(packageId, eSignUser.Email)

And all seems to be well again. So there appears to be an issue with using an email address (SignerBuilder.NewSignerWithEmail()) and then setting the Id to the same email address. However something I found on CreateSessionToken() via google is that starting in API version 10.6 you do not need to set the Custom Id and can just use the email address directly in the call to CreateSessionToken (See here), that's effectively what I'm doing now by commenting out my offending code and changing the one line later on. So now that that's all taken care of, does anyone know of a better way to get error messages out of the ESLClient in .NET in this situation? I feel this could have easily been tracked down had I known more information about what it was complaining about instead of resorting to playing whack-a-mole with commenting out chunks of code..


Subscriptions

Topics Replies Freshness Views Users
Hello, I recently updated the api version for Silanis.ESL.dll from 10.3 to 10.13, after doing so the code that I'm using to dynamically build the packages for getting signed no longer works.
4 7 years 4 months ago 42
Profile picture for user mwilliams

Code Share

This user has not submitted any code shares.

Subscriptions Release Notes

This user is not subscribed to any release notes.