8

我正在使用 Adob​​e EchoSign 网络服务在 vb.net 中创建一个 SendDocument 函数。我在这篇文章Using EchoSign API in VB.net中尝试了解决方案,但没有运气。

我收到一个错误

“String”类型的值无法转换为“secure.echosign.com.ArrayOfString”

在我下面的代码中 .recipients = recipients(0)

Public Sub SendDocument(ByVal apiKey, ByVal fileName, ByVal formFieldLayerTemplateKey, ByVal recipient)  

Dim recipients() As String = recipient

Dim docRecipient As RecipientInfo = New RecipientInfo()
With docRecipient
    .email = recipient
    .fax = "800-123-4567"
    .role = RecipientRole.SIGNER
End With

Dim docCreationInfo As DocumentCreationInfo = New DocumentCreationInfo()
With docCreationInfo
     .recipients = docRecipient(0)
     .name = Path.GetFileName(File.Name)
     .message = TestMessage
     .fileInfos = fileInfos
     .signatureType = SignatureType.ESIGN
    .signatureFlow = SignatureFlow.SENDER_SIGNATURE_NOT_REQUIRED
End With

当我尝试.recipients = recipients错误时

“字符串的一维数组”类型的值无法转换为“secure.echosign.com.ArrayOfString”。

有关如何解决错误的任何建议?

4

1 回答 1

1

Try assigning an array of RecipientInfo objects to the .recipients field:

'create a RecipientInfo object
Dim docRecipient As RecipientInfo = New RecipientInfo
With docRecipient
    .email = recipient
    .fax = "800-123-4567"
    .role = RecipientRole.SIGNER
End With

'create a RecipientInfo array with your new object as its contents
Dim recipients() As RecipientInfo = { docRecipient }

'create a DocumentCreationInfo and assign the array to the recipients field
Dim docCreationInfo As DocumentCreationInfo = New DocumentCreationInfo
With docCreationInfo
    .recipients = recipients
    .name = Path.GetFileName(File.Name)
    .message = TestMessage
    .fileInfos = fileInfos
    .signatureType = SignatureType.ESIGN
    .signatureFlow = SignatureFlow.SENDER_SIGNATURE_NOT_REQUIRED
End With
于 2014-08-18T19:19:30.407 回答