我已经在DocuSign中注册了我的帐户并使用了SOAP接口。我可以使用以下代码成功登录。
登录代码
var req = new LoginRequest() { Body = body };
var result = credential.Login(req);
if (result.Body != null && result.Body.LoginResult != null)
{
var account = result.Body.LoginResult.Accounts.First();
var BaseUrl = account.BaseUrl;
var AccountId = account.AccountID;
var UserName = account.AccountName;
var Email = account.Email;
}
但是,我在创建信封时收到未指定的错误。 另外,我是否需要在创建信封时使用BaseUrl?
请求标题
request = base.GetWebRequest(uri) as HttpWebRequest;
request.Headers.Add("X-DocuSign-Authentication",
string.Format("<DocuSignCredentials><Username>{0}</Username>
<Password>{1}</Password><IntegratorKey>{2}</IntegratorKey></DocuSignCredentials>",
UserName, Password,integratorkey));
创建信封的代码
//Create new envelope
var envelope = new Envelope();
envelope.AccountId = "***";
envelope.Subject = "envelope subject";
//Create the Receipents
recipient[] recipients;
recipients.Add(new recipient{ .... });
envelope.Recipients = recipients
//Grab and make the Documents
Document[] documents;
documents.Add(new Document{ ... });
envelope.Documents = documents;
var docusignWebService = new DocuSignWebService();
docusignWebService.UserName = "****"; // user email id
docusignWebService.Password = "****"; //user password
docusignWebService.AccountId = "****";
//create envelope
docusignWebService.CreateEnvelope(envelope);
我们对企业使用相同的代码并且它运行良好,但现在它不适用于个人帐户。 我们得到一个Unspecified_Error,内部异常为null。