gpt4 book ai didi

docusignapi - 在 C# 中通过 DocuSign api 登录时出现 "The operation has timed out"错误

转载 作者:行者123 更新时间:2023-12-04 18:56:52 26 4
gpt4 key购买 nike

自 2018 年 5 月 31 日起,我在登录时从 DocuSign API 收到以下错误。

DocuSign.eSign.Client.ApiException: 'Error calling Login: The operation has timed out'.



自去年以来,我们一直在测试 DocuSign API,并且在我们的内部集成应用程序中一切正常。昨天是我们第一次在登录时收到此错误消息,问题仍然存在。如果我通过演示 DocuSign 网站登录 https://appdemo.docusign.com ,我可以登录。
但是,如果我通过 DocuSign API 尝试相同的方法,则会出现超时错误。
Configuration.ApiClient.Configuration.ApiClient.RestClient.BaseUrl设置为 https://demo.docusign.net/restapi/
new System.Collections.Generic.Mscorlib_DictionaryDebugView<string, string>(Configuration.DefaultHeader).Items[0]被设定为 {[X-DocuSign-Authentication, {"Username":[username], "Password":[password], "IntegratorKey":[IntegratorKey]}]}
我们根本没有更改用户名或密码或 IntegratorKey。
response.StatusCode的值返回 0。请在下面找到我的登录代码。
public ApiResponse< LoginInformation > LoginWithHttpInfo (AuthenticationApi.LoginOptions options = null)
{

var path_ = "/v2/login_information";

var pathParams = new Dictionary<String, String>();
var queryParams = new Dictionary<String, String>();
var headerParams = new Dictionary<String, String>(Configuration.DefaultHeader);
var formParams = new Dictionary<String, String>();
var fileParams = new Dictionary<String, FileParameter>();
Object postBody = null;

// to determine the Content-Type header
String[] httpContentTypes = new String[] {

};
String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes);

// to determine the Accept header
String[] httpHeaderAccepts = new String[] {
"application/json"
};
String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAccept != null)
headerParams.Add("Accept", httpHeaderAccept);

// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
pathParams.Add("format", "json");


if (options != null)
{
if (options.apiPassword != null) queryParams.Add("api_password", Configuration.ApiClient.ParameterToString(options.apiPassword)); // query parameter
if (options.includeAccountIdGuid != null) queryParams.Add("include_account_id_guid", Configuration.ApiClient.ParameterToString(options.includeAccountIdGuid)); // query parameter
if (options.loginSettings != null) queryParams.Add("login_settings", Configuration.ApiClient.ParameterToString(options.loginSettings)); // query parameter

}


// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_,
Method.GET, queryParams, postBody, headerParams, formParams, fileParams,
pathParams, httpContentType);

int statusCode = (int) response.StatusCode;

if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling Login: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling Login: " + response.ErrorMessage, response.ErrorMessage);

return new ApiResponse<LoginInformation>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(LoginInformation) Configuration.ApiClient.Deserialize(response, typeof(LoginInformation)));

}

最佳答案

DocuSign Support Website

For more details please read the link

enter image description here



代码变更

请在您的代码中执行以下更改(在红色框中)。

快速修复

enter image description here

代码行
  ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

请确保 using System.Net;存在于您的命名空间中。

关于docusignapi - 在 C# 中通过 DocuSign api 登录时出现 "The operation has timed out"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50634774/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com