2017-03-06 130 views
0

我正在使用Java SDK在Android應用程序中測試Docusign嵌入式簽名模擬帳戶。到目前爲止,我已經能夠簽署PDF文檔,並通過深層鏈接將returnUrl發送回我的應用程序。都好。但在收到應用程序中的簽名確認後,我需要獲得完成證書。但是,當我打電話EnvelopesApi.getDocument(帳戶,envelopeId,「組合拳」)我得到以下錯誤:EnvelopesApi.getDocument - 錯誤:java.lang.Class不能轉換爲java.lang.reflect.ParameterizedType

java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType 

我知道帳戶ID,envelopeId是有效的,不空無誤。我也使用了我用來簽署文檔的相同ApiClient,所以它也是有效的並且可以工作。有誰知道這次電話會出現什麼問題?

這是呼叫

EnvelopesApi api = new EnvelopesApi(apiClient); 
try { 

    // The error is in the line below: 

    byte[] pdfBytes = api.getDocument(accountId, envelopeId, "combined"); 

} catch (ApiException e) { 
    e.printStackTrace(); 
} 

以下是完整的錯誤日誌:

E/AndroidRuntime: FATALEXCEPTION: AsyncTask #3 
      java.lang.RuntimeException: An error occurred while executing doInBackground() 
       at android.os.AsyncTask$3.done(AsyncTask.java:309) 
       at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) 
       at java.util.concurrent.FutureTask.setException(FutureTask.java:223) 
       at java.util.concurrent.FutureTask.run(FutureTask.java:242) 
       at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) 
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
       at java.lang.Thread.run(Thread.java:818) 
      Caused by: java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType 
       at com.sun.jersey.api.client.GenericType.getClass(GenericType.java:103) 
       at com.sun.jersey.api.client.GenericType.<init>(GenericType.java:72) 
       at com.docusign.esign.api.EnvelopesApi$24.<init>(EnvelopesApi.java:1928) 
       at com.docusign.esign.api.EnvelopesApi.getDocument(EnvelopesApi.java:1928) 
       at com.docusign.esign.api.EnvelopesApi.getDocument(EnvelopesApi.java:1849) 
       at br.com.cbyk.privatelabel.NovaPropostaActivity$2.doInBackground(NovaPropostaActivity.java:454) 
       at br.com.cbyk.privatelabel.NovaPropostaActivity$2.doInBackground(NovaPropostaActivity.java:448) 
       at android.os.AsyncTask$2.call(AsyncTask.java:295) 
       at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
       at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)  
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)  
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)  
       at java.lang.Thread.run(Thread.java:818)' 

回答

1

試試這個

File document = envelopesApi.getDocument(accountId, envelopeId, documentId); 

查看完整的API配方here

+0

也許API食譜是在這個調用中只是錯誤,因爲「envelopesApi.getDocuments」不會返回文件類型。它返回字節[]。或者我錯過了什麼? –

+0

對此有任何新意見,@CodingDawg? –

相關問題