-->

DocuSign API Envelope creation timed out

2019-08-31 06:12发布

问题:

I'm using the inofficial .NET Core DocuSign SDK (https://github.com/mitchdowd/DocuSign.NetCore) to call the API and ran into the same issue as reported in this question: Docusign eSign: CreateEnvelope requests timing out

When calling CreateEnvelope of the EnvelopesApi class I'm getting an ApiException The operation has timed out. from DocuSign.eSign:

Error calling CreateEnvelope: The operation has timed out.

I just tried to fix it the same way as provided by the answer in the linked question (https://stackoverflow.com/a/47685989/5373084). But the timeout doesn't seem to be applied, since the request always cancels after a duration of 100 secs (the default timeout of DocuSign ApiClient Configuration). That's some kind of weird because I can validate the configured timeout values within Configuration, ApiClient and internal RestClient objects. I also checked the eSign version, but this already points to 2.1.0 as dictated:

using DocuSignConfig = DocuSign.eSign.Client.Configuration;

...

Console.WriteLine(DocuSignConfig.Version); // 2.1.0

var envelopesApi = new EnvelopesApi();
envelopesApi.Configuration.Timeout = (int)TimeSpan.FromMinutes(5).TotalMilliseconds; // 300000 [ms]

Console.WriteLine(envelopesApi.Configuration.Timeout);                         // 300000 [ms]
Console.WriteLine(envelopesApi.Configuration.ApiClient.Configuration.Timeout); // 300000 [ms]
Console.WriteLine(envelopesApi.Configuration.ApiClient.RestClient.Timeout);    // 300000 [ms]

Console.WriteLine(DocuSignConfig.Default.Timeout);                         // 300000 [ms]
Console.WriteLine(DocuSignConfig.Default.ApiClient.Configuration.Timeout); // 300000 [ms]
Console.WriteLine(DocuSignConfig.Default.ApiClient.RestClient.Timeout);    // 300000 [ms]

Edit

With enabled logs like suggested in the comments, I receive the following logs for the createEnvelope API Call only if I use small documents.

POST https://demo.docusign.net:7802/restapi/v2/accounts/5ee37bb4-3236-4fbf-ae75-3c6557ce05cd/envelopes

TraceToken: 15858281-7274-45d5-a225-0d5bef9361e4
Timestamp: 2018-03-27T09:07:13.3371279Z

Content-Length: 2091681
Content-Type: application/json
Connection: Keep-Alive
Accept: application/json
Authorization: Bearer [omitted]
Host: demo.docusign.net
X-DocuSign-SDK: C#
X-SecurityProtocol-Version: TLSv1.2
X-SecurityProtocol-CipherSuite: ECDHE-RSA-AES256-GCM-SHA384
x-forwarded-for: 213.209.125.226

{"compositeTemplates":[{"document":{"documentBase64":"JVBERi0xc5NjcgMDAwMDAgbiAKMDA...GVlMjg+XQo+PgpzdGFydHhyZWYKMTU2Njg5MQolJUVPRgo=","documentId":"29909651","name":"Vorlage_Uebergabebescheinigung.pdf"},"inlineTemplates":[{"recipients":{"signers":[{"email":"...","name":"...","recipientId":"52058444","roleName":"FirstSigner","tabs":{"signHereTabs":[{"documentId":"29909651","pageNumber":"1","recipientId":"52058444","tabLabel":"FirstSignature","xPosition":"334","yPosition":"370"}],"textTabs":[{"documentId":"29909651","pageNumber":"1","tabId":"5e1c8a36-4ea0-416e-a1e6-429fd3bbfb99","tabLabel":"NextDayDatebox","value":"28.03.2018","xPosition":"460","yPosition":"255"},{"documentId":"29909651","pageNumber":"1","tabId":"70c7ce8e-1617-4647-af13-f2bdbcde12df","tabLabel":"InThreeMonthsDatebox","value":"28.06.2018","xPosition":"460","yPosition":"275"},{"documentId":"29909651","pageNumber":"1","tabId":"4eeafb8b-81a9-4f5b-a444-bedfa930990e","tabLabel":"CommentTextBox","xPosition":"328","yPosition":"295"}]}},{"email":"...","name":"...","recipientId":"83811752","roleName":"SecondSigner","tabs":{"signHereTabs":[{"documentId":"29909651","pageNumber":"1","recipientId":"83811752","tabLabel":"SecondSignature","xPosition":"454","yPosition":"370"}]}}]},"sequence":"1"}],"serverTemplates":[{"sequence":"2","templateId":"7eb643e2-b4c2-4f7e-89ff-599e7931b928"}]}],"emailSubject":"Bitte Vorlage_Uebergabebescheinigung.pdf signieren","status":"sent"}


201 Created
Content-Type: application/json; charset=utf-8
X-DocuSign-TraceToken: 15858281-7274-45d5-a225-0d5bef9361e4

{
  "envelopeId": "b7b37fff-737a-40fb-abd9-4f9ec2373a5e",
  "uri": "/envelopes/b7b37fff-737a-40fb-abd9-4f9ec2373a5e",
  "statusDateTime": "2018-03-27T09:07:13.1800000Z",
  "status": "sent"
}

But if I try to test the same code using large documents the call reaches the timeout threshold value and I don't see any logs about this call.

----

What am I missing?

Any hint would be really appreciated!

Thanks in advance!

回答1:

The link which I shared in my comment for file size limit explicitly says that maximum size of document which can be uploaded is 25 MB, you will get timeout from DocuSign if you want to upload any doc > 25 MB directly in an create envelope call.So, if you want to upload 34 MB document then use ChunkUpload. There is no way to customize payload size, it is 25 MB only.