【问题标题】:Adobe Echo Sign Sending PDF fileAdobe Echo Sign 发送 PDF 文件
【发布时间】:2013-07-22 08:51:37
【问题描述】:

我正在研究 Adob​​e Echo 标志,我已经从他们的网站下载了示例代码,我正在使用这个示例代码来发送文档,它在 sendDocument 方法中缺少一些代码,所以我已经更改了它。它给出了 SoapHeader 异常,而 InnerException 中没有任何内容,

{"apiActionId=XHZI4WF4BV693YS"}

下面是我发送文件的代码

 public static void sendDocument(string apiKey, string fileName, string recipient)
        {
            ES = new EchoSignDocumentService16();
            FileStream file = File.OpenRead(fileName);
            secure.echosign.com.FileInfo[] fileInfos = new secure.echosign.com.FileInfo[1];
            fileInfos[0] = new secure.echosign.com.FileInfo(fileName, null, file);
            SenderInfo senderInfo = null;
            string[] recipients = new string[1];
            recipients[0] = recipient;
            DocumentCreationInfo documentInfo = new DocumentCreationInfo(
                recipients,
                "Test from SOAP: " + fileName,
                "This is neat.",
                fileInfos,
                SignatureType.ESIGN,
                SignatureFlow.SENDER_SIGNATURE_NOT_REQUIRED
            );

            DocumentKey[] documentKeys;
            senderInfo = new SenderInfo(recipient, "password", "APIKEY");
            documentKeys = ES.sendDocument(apiKey, senderInfo, documentInfo);
            Console.WriteLine("Document key is: " + documentKeys[0].documentKey);
        }

它在这一行给出异常

 documentKeys = ES.sendDocument(apiKey, senderInfo, documentInfo);

谁能推荐一些 Adob​​e Echo Sign 的示例代码?

【问题讨论】:

    标签: echosign


    【解决方案1】:

    在您登录的帐户页面上,您可以查看 API 日志。如果您检查您的请求的日志条目,您可以在那里找到更多信息。

    我看不出您的代码有什么问题,但是 EchoSign API 指南说“tos”字段已被弃用,应该改用收件人字段。有用的是,这意味着您不能使用参数化构造函数。尝试这样创建您的文档创建信息(这是 C#,但如果您需要 Java,应该很容易弄清楚):

    RecipientInfo[] recipientInfo = new RecipientInfo[1];
    recipientInfo[0] = new RecipientInfo
    {
        email = "recipient",
        role = RecipientRole.SIGNER,
        roleSpecified = true 
    };
    
    DocumentCreationInfo documentCreationInfo = new DocumentCreationInfo
    {
        recipients = recipientInfo,
        name = "Test from SOAP: " + fileName,
        message = "This is neat.",
        fileInfos = fileInfos,
        signatureType = SignatureType.ESIGN,
        signatureFlow = SignatureFlow.SENDER_SIGNATURE_NOT_REQUIRED
    };
    

    请注意,当使用 recipientInfo 数组时,roleSpecified 字段必须 设置为 true。这个小领域让我绊倒了好久,我收到的错误与你的类似。

    【讨论】:

      猜你喜欢
      • 2016-09-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-22
      • 1970-01-01
      • 2018-08-15
      • 1970-01-01
      相关资源
      最近更新 更多