2013-07-02 57 views
0

我正在使用Adobe Echo標誌,我已經從他們的網站下載了示例代碼,我正在使用此示例代碼來發送文檔,它在sendDocument方法中缺少一些代碼,所以我更改了它。它給SOAPHEADER例外,沒什麼的InnerException,Adob​​e Echo Sign發送PDF文件

{"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); 

任何人都可以提出一些示例代碼的Adobe Echo Sign?

回答

0

在您登錄的帳戶頁面上有一個您可以檢查的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。這個小小的場地讓我絆倒了很久,而且我收到了類似於你的錯誤。