Использование EchoSign API в VB.net
Я пытаюсь преобразовать пример кода C#, предоставленный моим эхосигналом в VB.net для использования в наших приложениях. В частности, метод SendDocument.
Кто-нибудь уже делал это?
API выдает сообщение об ошибке "Ошибка: java.lang.NullPointerException" при каждом вызове.
Вот преобразованная функция:
Public Shared Function SendDocument(ByVal apiKey As String, ByVal file As Byte(), ByVal recipientEmailAddress As String, ByVal fileName As String, ByVal message As String, ByVal expireDays As Int32) As String
Try
Dim ES As EchoSignDocumentService13 = New EchoSignDocumentService13()
ES.Url = "https://secure.echosign.com/services/EchoSignDocumentService13"
Dim recipients(1) As String
recipients(0) = recipientEmailAddress
Dim localSenderInfo As com.echosign.secure.SenderInfo = Nothing
Dim echoFileInfo(1) As com.echosign.secure.FileInfo
echoFileInfo(0) = New com.echosign.secure.FileInfo()
With echoFileInfo(0)
.fileName = fileName
.mimeType = "application/msword"
.file = file
End With
Dim echoDocumentInfo As com.echosign.secure.DocumentCreationInfo = New com.echosign.secure.DocumentCreationInfo()
With echoDocumentInfo
.tos = recipients
.name = fileName
.message = message
.fileInfos = echoFileInfo
.signatureType = SignatureType.ESIGN
.signatureFlow = SignatureFlow.SENDER_SIGNATURE_NOT_REQUIRED
.daysUntilSigningDeadline = expireDays
End With
Dim echoKey() As DocumentKey
echoKey = ES.sendDocument(apiKey, localSenderInfo, echoDocumentInfo)
Return echoKey(0).documentKey.ToString()
Catch ex As Exception
Return "EchoError: " & ex.Message
End Try
End Function
Любая помощь приветствуется
Спасибо
Ричард