Get DocumentObject from DocId or ContainerId

This commit is contained in:
Jonathan Jenne
2019-03-05 12:16:16 +01:00
parent bbd761c0ad
commit ec616ac9b8
14 changed files with 323 additions and 38 deletions

View File

@@ -8,22 +8,14 @@ Public Class Document
Private _logConfig As LogConfig
Private _channelFactory As ChannelFactory(Of IEDMServiceChannel)
Private _channel As IEDMServiceChannel
Public Sub New(LogConfig As LogConfig, EDMI_ServiceAdress As String)
Public Sub New(LogConfig As LogConfig, ServiceAdress As String)
_logger = LogConfig.GetLogger()
_logConfig = LogConfig
Try
Dim binding As New NetTcpBinding()
binding.Security.Mode = SecurityMode.Transport
binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows
binding.MaxReceivedMessageSize = 2147483647
binding.MaxBufferSize = 2147483647
binding.MaxBufferPoolSize = 2147483647
binding.MaxConnections = 10000
binding.ReaderQuotas.MaxArrayLength = 2147483647
binding.ReaderQuotas.MaxStringContentLength = 2147483647
Dim endpointAddress = New EndpointAddress(EDMI_ServiceAdress)
_channelFactory = New ChannelFactory(Of IEDMServiceChannel)(binding, endpointAddress)
Dim oBinding = Channel.GetBinding()
Dim oAddress = New EndpointAddress(ServiceAdress)
_channelFactory = New ChannelFactory(Of IEDMServiceChannel)(oBinding, oAddress)
Connect2NetService()
Catch ex As Exception
_logger.Error(ex)
@@ -110,6 +102,24 @@ Public Class Document
End Try
End Function
Public Function GetDocumentByDocumentId(DocumentId As Int64) As DocumentResult
Try
Return _channel.GetDocumentByDocumentId(DocumentId)
Catch ex As Exception
_logger.Error(ex)
Throw ex
End Try
End Function
Public Function GetDocumentByContainerId(ContainerId As String) As DocumentResult
Try
Return _channel.GetDocumentByContainerId(ContainerId)
Catch ex As Exception
_logger.Error(ex)
Throw ex
End Try
End Function
'Public Async Function New_EDMI_File(oFILENAME As String, oUserName As String) As Task(Of String)
' Try
' Dim oFileGUID As DocumentResult = Await CreateDocument(oFILENAME)