Docusignapi DocuSign.eSign.Client.ApiException:未处理的响应类型
正在尝试使用DocuSign.eSign Nuget包5.2.0 在下面代码的第53行获取异常(DocuSign.eSign.Client.ApiException:未处理的响应类型) 第52行:var envelopesApi=新的envelopesApi(apiClient); 第53行:信封摘要结果=信封API.CreateEnvelope(accountId,信封) [ApiException:未处理的响应类型。] DocuSign.eSign.Client.ApiClient.Deserialize(字节[]内容,类型类型,IListDocusignapi DocuSign.eSign.Client.ApiException:未处理的响应类型,docusignapi,Docusignapi,正在尝试使用DocuSign.eSign Nuget包5.2.0 在下面代码的第53行获取异常(DocuSign.eSign.Client.ApiException:未处理的响应类型) 第52行:var envelopesApi=新的envelopesApi(apiClient); 第53行:信封摘要结果=信封API.CreateEnvelope(accountId,信封) [ApiException:未处理的响应类型。] DocuSign.eSign.Client.ApiClient.Dese
1头)+261 DocuSign.eSign.Api.EnvelopesApi.CreateEnvelopeWithHttpInfo(String accountId,EnvelopedDefinition EnvelopedDefinition,CreateEnvelopeOptions)+3410 DocuSign.eSign.Api.EnvelopesApi.CreateEnvelope(String accountId、EnvelopedDefinition EnvelopedDefinition、CreateEnvelopeOptions选项)+83 motr.docusign.DocumentSigningManager.DoWork(String SignerMail、String signerName、String accessToken、String basePath、String accountId)位于D:\Pankaj\Dev\mot-r\motr.docusign\Class1.cs:53 motr.Web.ApiControllers.DSConnectController.SendDocument()在D:\Pankaj\Dev\mot-r\motr.Web\ApiControllers\DSConnectController.cs:132 lambda_方法(闭包,ControllerBase,Object[])+87 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext ControllerContext,IDictionary
2个参数)+229中
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext ControllerContext,ActionDescriptor ActionDescriptor,IDictionary2参数)+35 System.Web.Mvc.Async.AsyncControllerActionInvoker.b_39(IAsyncResult asyncResult,ActionInvokeInnerInvokeState)++39 System.Web.Mvc.Async.WrappedAsyncResult
2.CallEndDelegate(IAsyncResult异步结果)+77
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)+42
System.Web.Mvc.Async.AsyncInvocationWithFilters.b__3d()+72
System.Web.Mvc.Async.c__DisplayClass46.b__3f()+396
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)+42
System.Web.Mvc.Async.c__显示类2b.b__1c()+38
System.Web.Mvc.Async.c__显示类21.b__1e(IAsyncResult asyncResult)+188
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)+38
System.Web.Mvc.Controller.b_u1d(IAsyncResult asyncResult,ExecuteCorerate innerState)+32
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult)+73 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)+52 System.Web.Mvc.Async.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult)+39
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)+38
System.Web.Mvc.MvcHandler.b_u5(IAsyncResult asyncResult,ProcessRequestState innerState)+46
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)+73
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)+38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+431
System.Web.c_uuudisplayClass285_0.b_uuu0()+38
System.Web.HttpApplication.executesteppl(IExecutionStep步骤)+11857001
System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔值&同步完成)+158
早在4.1.0之前就尝试过使用旧版本,但都遇到了相同的问题
我正在使用.netCore的一个示例代码,并尝试使用可用的Nuget包将其与.NETFramework4.8结合使用 这是我的密码:
using DocuSign.eSign.Api;
using DocuSign.eSign.Client;
using DocuSign.eSign.Model;
using motr.docusign.model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace motr.docusign
{
public class DocumentSigningManager
{
private string dsPingUrl;
private string signerClientId = "1000";
private string dsReturnUrl;
private DSConfiguration Config;
private IRequestItemsService RequestItemsService;
public DocumentSigningManager()
{
Config = new DSConfiguration();
dsPingUrl = Config.AppUrl + "/";
dsReturnUrl = Config.AppUrl + "/dsReturn";
}
public string DoWork(string signerEmail, string signerName,
string accessToken, string basePath, string accountId)
{
EnvelopeDefinition envelope = MakeEnvelope(signerEmail, signerName);
var apiClient = new DocuSign.eSign.Client.ApiClient(basePath);
apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + accessToken);
var envelopesApi = new EnvelopesApi(apiClient);
EnvelopeSummary results = envelopesApi.CreateEnvelope(accountId, envelope);
string envelopeId = results.EnvelopeId;
RecipientViewRequest viewRequest = MakeRecipientViewRequest(signerEmail, signerName);
ViewUrl results1 = envelopesApi.CreateRecipientView(accountId, envelopeId, viewRequest);
string redirectUrl = results1.Url;
return redirectUrl;
}
private RecipientViewRequest MakeRecipientViewRequest(string signerEmail, string signerName)
{
RecipientViewRequest viewRequest = new RecipientViewRequest();
viewRequest.ReturnUrl = dsReturnUrl + "?state=123";
viewRequest.AuthenticationMethod = "none";
viewRequest.Email = signerEmail;
viewRequest.UserName = signerName;
viewRequest.ClientUserId = signerClientId;
viewRequest.PingFrequency = "600";
viewRequest.PingUrl = dsPingUrl;
return viewRequest;
}
private EnvelopeDefinition MakeEnvelope(string signerEmail, string signerName)
{
EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition();
envelopeDefinition.EmailSubject = "Please sign this document";
Signer signer1 = new Signer
{
Email = signerEmail,
Name = signerName,
ClientUserId = signerClientId,
RecipientId = "1"
};
Recipients recipients = new Recipients
{
Signers = new List<Signer> { signer1 }
};
envelopeDefinition.Recipients = recipients;
envelopeDefinition.Status = "sent";
return envelopeDefinition;
}
}
}
使用DocuSign.eSign.Api;
使用DocuSign.eSign.Client;
使用DocuSign.eSign.Model;
使用motr.docusign.model;
使用制度;
使用System.Collections.Generic;
使用System.Linq;
使用系统文本;
使用System.Threading.Tasks;
名称空间motr.docusign
{
公共类文档签名管理器
{
私有字符串dsPingUrl;
私有字符串signerClientId=“1000”;
私有字符串dsReturnUrl;
专用配置;
私有IRequestItemsService请求项服务;
公共文档签名管理器()
{
Config=新的DSConfiguration();
dsPingUrl=Config.AppUrl+“/”;
dsReturnUrl=Config.AppUrl+“/dsReturn”;
}
公共字符串工作(字符串签名邮件、字符串签名名称、,
字符串accessToken、字符串basePath、字符串accountId)
{
信封定义信封=制作信封(SignerMail,signerName);
var apiClient=new DocuSign.eSign.Client.apiClient(basePath);
添加(“授权”、“承载人”+accessToken);
var envelopesApi=新的envelopesApi(apiClient);
EnvelopesSummary results=envelopesApi.CreateEnvelope(accountId,envelope);
字符串envelopeId=results.envelopeId;
RecipientViewRequest-viewRequest=MakeRecipientViewRequest(SignerMail,signerName);
ViewUrl results1=envelopesApi.CreateRecipientView(accountId、envelopeId、viewRequest);
字符串重定向Url=results1.Url;
返回重定向URL;
}
私有RecipientViewRequest生成RecipientViewRequest(字符串SignerMail,字符串signerName)
{
RecipientViewRequest viewRequest=新RecipientViewRequest();
viewRequest.ReturnUrl=dsReturnUrl+“?状态=123”;
viewRequest.AuthenticationMethod=“无”;
viewRequest.Email=signerEmail;
viewRequest.UserName=signerName;
viewRequest.ClientUserId=signerClientId;
viewRequest.PingFrequency=“600”;
viewRequest.PingUrl=dsPingUrl;
返回视图请求;
}
私有信封定义生成信封(字符串签名邮件、字符串签名名称)
{
包络限定