WIP: EDMI Service

This commit is contained in:
Jonathan Jenne
2020-04-15 12:09:01 +02:00
parent a20c0eb4b0
commit 62e4e409a6
17 changed files with 226 additions and 117 deletions

View File

@@ -52,7 +52,7 @@ Public Class Form1
Await oStream.ReadAsync(oContents, 0, oFileInfo.Length)
End Using
Dim oResult As EDMIServiceReference.DocumentResult2 = Await _Channel.ImportFileAsync(oFileInfo.Name, oContents, Environment.UserName)
Dim oResult As EDMIServiceReference.DocumentResult = Await _Channel.ImportFileAsync(oFileInfo.Name, oContents, Environment.UserName)
If oResult.OK Then
listboxLog.Items.Add($"File [{oFileInfo.Name}] with Id [{oResult.Document.FileId}] imported!")
Else
@@ -121,14 +121,14 @@ Public Class Form1
Dim oObjectId As Integer = TextboxObejctId.EditValue
Dim oStream = Await _Channel.GetFileByObjectIdAsync(oObjectId)
Dim oResponse = Await _Channel.GetFileByObjectIdAsync(New EDMIServiceReference.DocumentStreamRequest() With {.ObjectId = oObjectId})
Dim oMemoryStream As New MemoryStream()
oStream.CopyTo(oMemoryStream)
oResponse.FileContents.CopyTo(oMemoryStream)
oMemoryStream.Position = 0
listboxLog.Items.Add("Stream read!")
DocumentViewer1.LoadFile("textfile.png", oMemoryStream)
DocumentViewer1.LoadFile(oResponse.FileName, oMemoryStream)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Uh oh!")
End Try