2

我正在尝试转换我在 VB.net 中提供的 echosign 示例 C# 代码,以便在我们的应用程序中使用。特别是 SendDocument 方法。

有没有人已经这样做了?

每当我调用它时,API 都会返回错误消息“Fault: 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

任何帮助都是最受欢迎的

谢谢

理查德

4

0 回答 0