Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# DocuSign API和DocumentPDFs docPDFs=apiService.RequestDocumentPDFs(envelopeID);_C#_Docusignapi - Fatal编程技术网

C# DocuSign API和DocumentPDFs docPDFs=apiService.RequestDocumentPDFs(envelopeID);

C# DocuSign API和DocumentPDFs docPDFs=apiService.RequestDocumentPDFs(envelopeID);,c#,docusignapi,C#,Docusignapi,我正在使用下面的代码连接到DocuSign API。 我做错了什么,我不断得到用户名和密码不正确时,他们是 String auth = "<DocuSignCredentials><Username>john.connolly@lechase.com</Username><Password>password</Password><IntegratorKey>20be051c-4c25-46c1-b0f1-1f10575a2e

我正在使用下面的代码连接到DocuSign API。
我做错了什么,我不断得到用户名和密码不正确时,他们是

String auth = "<DocuSignCredentials><Username>john.connolly@lechase.com</Username><Password>password</Password><IntegratorKey>20be051c-4c25-46c1-b0f1-1f10575a2e40</IntegratorKey></DocuSignCredentials>";

DSAPIServiceSoapClient client = new DSAPIServiceSoapClient("DSAPIServiceSoap");
using (System.ServiceModel.OperationContextScope scope = new System.ServiceModel.OperationContextScope(client.InnerChannel))
{
    System.ServiceModel.Channels.HttpRequestMessageProperty httpRequestProperty = new System.ServiceModel.Channels.HttpRequestMessageProperty();
    httpRequestProperty.Headers.Add("X-DocuSign-Authentication", auth);
    System.ServiceModel.OperationContext.Current.OutgoingMessageProperties[System.ServiceModel.Channels.HttpRequestMessageProperty.Name] = httpRequestProperty;

    EnvelopeStatus status = client.RequestStatusEx("12d46951-1f1c-48cd-9a28-e51685d67ccd");
    Console.Out.WriteLine("Subject: " + status.Subject);
}
String auth=“约翰。connolly@lechase.compassword20be051c-4c25-46c1-b0f1-1f10575a2e40”;
DSAPIServiceSoapClient=新的DSAPIServiceSoapClient(“DSAPIServiceSoap”);
使用(System.ServiceModel.OperationContextScope范围=新的System.ServiceModel.OperationContextScope(client.InnerChannel))
{
System.ServiceModel.Channels.HttpRequestMessageProperty httpRequestProperty=新建System.ServiceModel.Channels.HttpRequestMessageProperty();
httpRequestProperty.Headers.Add(“X-DocuSign-Authentication”,auth);
System.ServiceModel.OperationContext.Current.OutgoingMessageProperties[System.ServiceModel.Channel.HttpRequestMessageProperty.Name]=httpRequestProperty;
信封状态=client.RequestStatusEx(“12d46951-1f1c-48cd-9a28-e51685d67ccd”);
Console.Out.WriteLine(“Subject:+status.Subject”);
}
由于您使用(使用X-DocuSign-Authentication标头):

  • 使用 检索帐户的帐号和基本URL。 登录方法的url是www.docusign.net,用于生产和销售 用于开发人员沙箱的demo.docusign.net。
    baseUrl
    字段为
    loginacount
    对象的一部分。见
  • 生产中所选帐户的baseUrl将以na1、na2、na3、eu1或其他内容开头。使用下面的baseUrl 返回以创建基本路径(请参阅下一步) 所有后续API调用的基本路径
  • 正如login方法返回的那样,baseUrl包括API版本和帐户id。拆分字符串以获得basePath,只需 服务器名称和api名称。你将得到
    https://na1.docusign.net/restapi/v2/accounts/123123123
    。你想要 只是
    https://na1.docusign.net/restapi
  • 使用基本路径实例化SDK。例如
    ApiClient-ApiClient=新的ApiClient(basePath)
  • 使用
    Configuration.Default.AddDefaultHeader
    设置验证标头,如示例所示
  • 示例代码:为您的身份验证字符串尝试一个逐字字符串

    string auth = @"<DocuSignCredentials>
                       <Username>john.connolly@lechase.com</Username>
                       <Password>S3cre+p455w0Rd</Password>
                       <IntegratorKey>20be051c-4c25-46c1-b0f1-1f10575a2e40</IntegratorKey>
                    </DocuSignCredentials>";
    
    DSAPIServiceSoapClient apiService = new DSAPIServiceSoapClient();            
    
    using (var scope = new System.ServiceModel.OperationContextScope(apiService.InnerChannel))
    {
        var httpRequestProperty = new System.ServiceModel.Channels.HttpRequestMessageProperty();
        httpRequestProperty.Headers.Add("X-DocuSign-Authentication", auth);
        System.ServiceModel.OperationContext.Current.OutgoingMessageProperties[System.ServiceModel.Channels.HttpRequestMessageProperty.Name] = httpRequestProperty;
    
        EnvelopeStatus envStatus = apiService.CreateAndSendEnvelope(envelope);
        return envStatus.EnvelopeID;
    }
    
    string auth=@”
    厕所。connolly@lechase.com
    S3cre+p455w0Rd
    20be051c-4c25-46c1-b0f1-1f10575a2e40
    ";
    DSAPIServiceSoapClient apiService=新的DSAPIServiceSoapClient();
    使用(var scope=new System.ServiceModel.OperationContextScope(apiService.InnerChannel))
    {
    var httpRequestProperty=new System.ServiceModel.Channels.HttpRequestMessageProperty();
    httpRequestProperty.Headers.Add(“X-DocuSign-Authentication”,auth);
    System.ServiceModel.OperationContext.Current.OutgoingMessageProperties[System.ServiceModel.Channel.HttpRequestMessageProperty.Name]=httpRequestProperty;
    EnvelopeStatus=apiService.CreateAndSendEnvelope(信封);
    返回envStatus.EnvelopeID;
    }
    
    由于您使用(使用X-DocuSign-Authentication标头):

  • 使用 检索帐户的帐号和基本URL。 登录方法的url是www.docusign.net,用于生产和销售 用于开发人员沙箱的demo.docusign.net。
    baseUrl
    字段为
    loginacount
    对象的一部分。见
  • 生产中所选帐户的baseUrl将以na1、na2、na3、eu1或其他内容开头。使用下面的baseUrl 返回以创建基本路径(请参阅下一步) 所有后续API调用的基本路径
  • 正如login方法返回的那样,baseUrl包括API版本和帐户id。拆分字符串以获得basePath,只需 服务器名称和api名称。你将得到
    https://na1.docusign.net/restapi/v2/accounts/123123123
    。你想要 只是
    https://na1.docusign.net/restapi
  • 使用基本路径实例化SDK。例如
    ApiClient-ApiClient=新的ApiClient(basePath)
  • 使用
    Configuration.Default.AddDefaultHeader
    设置验证标头,如示例所示
  • 示例代码:为您的身份验证字符串尝试一个逐字字符串

    string auth = @"<DocuSignCredentials>
                       <Username>john.connolly@lechase.com</Username>
                       <Password>S3cre+p455w0Rd</Password>
                       <IntegratorKey>20be051c-4c25-46c1-b0f1-1f10575a2e40</IntegratorKey>
                    </DocuSignCredentials>";
    
    DSAPIServiceSoapClient apiService = new DSAPIServiceSoapClient();            
    
    using (var scope = new System.ServiceModel.OperationContextScope(apiService.InnerChannel))
    {
        var httpRequestProperty = new System.ServiceModel.Channels.HttpRequestMessageProperty();
        httpRequestProperty.Headers.Add("X-DocuSign-Authentication", auth);
        System.ServiceModel.OperationContext.Current.OutgoingMessageProperties[System.ServiceModel.Channels.HttpRequestMessageProperty.Name] = httpRequestProperty;
    
        EnvelopeStatus envStatus = apiService.CreateAndSendEnvelope(envelope);
        return envStatus.EnvelopeID;
    }
    
    string auth=@”
    厕所。connolly@lechase.com
    S3cre+p455w0Rd
    20be051c-4c25-46c1-b0f1-1f10575a2e40
    ";
    DSAPIServiceSoapClient apiService=新的DSAPIServiceSoapClient();
    使用(var scope=new System.ServiceModel.OperationContextScope(apiService.InnerChannel))
    {
    var httpRequestProperty=new System.ServiceModel.Channels.HttpRequestMessageProperty();
    httpRequestProperty.Headers.Add(“X-DocuSign-Authentication”,auth);
    System.ServiceModel.OperationContext.Current.OutgoingMessageProperties[System.ServiceModel.Channel.HttpRequestMessageProperty.Name]=httpRequestProperty;
    EnvelopeStatus=apiService.CreateAndSendEnvelope(信封);
    返回envStatus.EnvelopeID;
    }
    
    我有点迷路了,你能给我这个的代码吗?我有点迷路了,你能给我这个的代码吗?