DocuSign API Envelope创建超时

时间:2018-03-26 16:38:07

标签: .net-core docusignapi

我正在使用非官方的.NET Core DocuSign SDK(https://github.com/mitchdowd/DocuSign.NetCore)来调用API并遇到与此问题中报告的问题相同的问题:Docusign eSign: CreateEnvelope requests timing out

在致电CreateEnvelope课程的EnvelopesApi时,我从ApiException获得了The operation has timed out. DocuSign.eSign

Error calling CreateEnvelope: The operation has timed out.

我只是尝试按照链接问题(https://stackoverflow.com/a/47685989/5373084)中答案提供的方式修复它。但是似乎没有应用超时,因为请求总是在100秒(DocuSign ApiClient配置的默认超时)之后取消。这有点奇怪,因为我可以在ConfigurationApiClient和内部RestClient对象中验证配置的超时值。我还检查了eSign版本,但这已经指出2.1.0如下:

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]

修改

使用评论中建议的已启用日志,只有在我使用小型文档时才会收到createEnvelope API调用的以下日志。

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"
}

但是,如果我尝试使用大型文档测试相同的代码,则调用达到超时阈值,并且我看不到有关此调用的任何日志。

----

我错过了什么?

任何提示都会非常感激!

提前致谢!

1 个答案:

答案 0 :(得分:0)

我在file size limit的评论中分享的链接明确表示可以上传的文档的最大尺寸为25 MB,如果您要上传任何文档{{},您将从DocuSign获得超时1}}直接在创建信封中调用。因此,如果要上传34 MB文档,请使用ChunkUpload。无法自定义有效负载大小,仅为> 25 MB