Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Value of type 'String' cannot be converted to 'secure.echosign.com.ArrayOfString'

I am using Adobe EchoSign web service to create a SendDocument function in vb.net. I tried the solution in this post Using EchoSign API in VB.net but no luck.

I am getting an error

Value of type 'String' cannot be converted to 'secure.echosign.com.ArrayOfString'

in my code below at .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

When I try .recipients = recipients the error reads

Value of type '1-dimensional array of String' cannot be converted to 'secure.echosign.com.ArrayOfString'.

Any suggestions on how to resolve the error?

like image 451
user3929962 Avatar asked Aug 18 '14 15:08

user3929962


1 Answers

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
like image 99
j.f. Avatar answered Nov 06 '22 03:11

j.f.