EDMIService: Update client and fix wrnog extension at import
This commit is contained in:
@@ -11,25 +11,27 @@ Public Class Client
|
||||
|
||||
Private Const KIND_TYPE_DOC = "DOC"
|
||||
|
||||
Private ReadOnly _LogConfig As LogConfig
|
||||
Private ReadOnly _logger As Logger
|
||||
Private ReadOnly _channelFactory As ChannelFactory(Of IEDMIServiceChannel)
|
||||
Private ReadOnly _IPAddressServer As String
|
||||
Private ReadOnly _PortServer As Integer
|
||||
|
||||
Private _dummy_table_attributes As DataTable
|
||||
Private _channel As IEDMIServiceChannel
|
||||
Private _FileEx As Filesystem.File
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Creates a new EDMI Client object
|
||||
''' </summary>
|
||||
''' <param name="LogConfig">LogConfig object</param>
|
||||
''' <param name="ServiceAdress">The IP address/hostname and port, separated by semicolon or colon, ex localhost:9000</param>
|
||||
Public Sub New(LogConfig As LogConfig, ServiceAdress As String)
|
||||
_logger = LogConfig.GetLogger()
|
||||
_FileEx = New Filesystem.File(LogConfig)
|
||||
''' <param name="pLogConfig">LogConfig object</param>
|
||||
''' <param name="pServiceAdress">The IP address/hostname and port, separated by semicolon or colon, ex. 1.2.3.4:9000</param>
|
||||
Public Sub New(pLogConfig As LogConfig, pServiceAdress As String)
|
||||
_LogConfig = pLogConfig
|
||||
_logger = pLogConfig.GetLogger()
|
||||
_FileEx = New Filesystem.File(pLogConfig)
|
||||
|
||||
Dim oServiceAddress As String = ServiceAdress
|
||||
Dim oServiceAddress As String = pServiceAdress
|
||||
Dim oAddressArray() As String
|
||||
|
||||
If oServiceAddress.Contains(";") Then
|
||||
@@ -40,8 +42,10 @@ Public Class Client
|
||||
|
||||
Try
|
||||
_IPAddressServer = oAddressArray(0)
|
||||
_PortServer = oAddressArray(1)
|
||||
|
||||
Dim oBinding = Channel.GetBinding()
|
||||
Dim oAddress = New EndpointAddress($"net.tcp://{oAddressArray(0)}:{oAddressArray(1)}/DigitalData/Services/Main")
|
||||
Dim oAddress = New EndpointAddress($"net.tcp://{_IPAddressServer}:{_PortServer}/DigitalData/Services/Main")
|
||||
Dim oFactory = New ChannelFactory(Of IEDMIServiceChannel)(oBinding, oAddress)
|
||||
|
||||
_channelFactory = oFactory
|
||||
@@ -243,6 +247,29 @@ Public Class Client
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetFileObject(pObjectId As Long) As FileObject
|
||||
Try
|
||||
Dim oGetFileObject As New Modules.Zooflow.GetFileObject(_LogConfig, Me)
|
||||
Dim oFileObject = oGetFileObject.Run(pObjectId)
|
||||
Return oFileObject
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function GetFileObjectAsync(pObjectId As Long) As Task(Of FileObject)
|
||||
Try
|
||||
Dim oGetFileObject As New Modules.Zooflow.GetFileObject(_LogConfig, Me)
|
||||
Dim oFileObject = Await oGetFileObject.RunAsync(pObjectId)
|
||||
Return oFileObject
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Sets a value to an attribute
|
||||
''' </summary>
|
||||
@@ -466,7 +493,6 @@ Public Class Client
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Private Function GetAttributesForObject(pObjectId As Long, pLanguage As String) As List(Of ObjectAttribute)
|
||||
Dim oAttributes As New List(Of ObjectAttribute)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user