EDMI: Include connection strings in client config
This commit is contained in:
parent
d319c87537
commit
de451e8c57
@ -87,12 +87,8 @@ Public Class Client
|
||||
Try
|
||||
ServerAddress = oAddressArray(0)
|
||||
ServerPort = oAddressArray(1)
|
||||
|
||||
Dim oBinding = API.Channel.GetBinding()
|
||||
Dim oAddress = New EndpointAddress($"net.tcp://{ServerAddress}:{ServerPort}/DigitalData/Services/Main")
|
||||
Dim oFactory = New ChannelFactory(Of IEDMIServiceChannel)(oBinding, oAddress)
|
||||
|
||||
ChannelFactory = oFactory
|
||||
Logger.Debug("Connecting to Service at: [{0}]", ServerAddress)
|
||||
ChannelFactory = GetChannelFactory(ServerAddress, ServerPort)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
@ -109,20 +105,24 @@ Public Class Client
|
||||
Logger = LogConfig.GetLogger()
|
||||
FileEx = New Filesystem.File(LogConfig)
|
||||
|
||||
UpdateTimer.Interval = 60 * 1000 * UPDATE_INTERVAL_IN_MINUTES
|
||||
UpdateTimer.Start()
|
||||
|
||||
Try
|
||||
ServerAddress = IPAddress
|
||||
Dim oBinding = API.Channel.GetBinding()
|
||||
Dim oAddress = New EndpointAddress($"net.tcp://{IPAddress}:{PortNumber}/DigitalData/Services/Main")
|
||||
Dim oFactory = New ChannelFactory(Of IEDMIServiceChannel)(oBinding, oAddress)
|
||||
|
||||
Logger.Debug("Connecting to Service at: [{0}]", oAddress)
|
||||
|
||||
ChannelFactory = oFactory
|
||||
Logger.Debug("Connecting to Service at: [{0}]", IPAddress)
|
||||
ChannelFactory = GetChannelFactory(IPAddress, PortNumber)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Function GetChannelFactory(pIPAddress As String, pPortNumber As Integer) As ChannelFactory(Of IEDMIServiceChannel)
|
||||
Dim oBinding = API.Channel.GetBinding()
|
||||
Dim oAddress = New EndpointAddress($"net.tcp://{pIPAddress}:{pPortNumber}/DigitalData/Services/Main")
|
||||
Dim oFactory = New ChannelFactory(Of IEDMIServiceChannel)(oBinding, oAddress)
|
||||
Return oFactory
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Connect to the service
|
||||
''' </summary>
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
<xs:schema xmlns:tns="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:complexType name="GlobalState.ClientConfiguration">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="ConnectionStringECM" nillable="true" type="xs:string" />
|
||||
<xs:element minOccurs="0" name="ConnectionStringIDB" nillable="true" type="xs:string" />
|
||||
<xs:element minOccurs="0" name="DocumentTypes" nillable="true" type="tns:ArrayOfGlobalState.Doctype" />
|
||||
<xs:element minOccurs="0" name="ForceDirectDatabaseAccess" type="xs:boolean" />
|
||||
</xs:sequence>
|
||||
|
||||
@ -638,6 +638,12 @@ Namespace EDMIServiceReference
|
||||
<System.NonSerializedAttribute()> _
|
||||
Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject
|
||||
|
||||
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
||||
Private ConnectionStringECMField As String
|
||||
|
||||
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
||||
Private ConnectionStringIDBField As String
|
||||
|
||||
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
||||
Private DocumentTypesField() As EDMIServiceReference.GlobalStateDoctype
|
||||
|
||||
@ -654,6 +660,32 @@ Namespace EDMIServiceReference
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<System.Runtime.Serialization.DataMemberAttribute()> _
|
||||
Public Property ConnectionStringECM() As String
|
||||
Get
|
||||
Return Me.ConnectionStringECMField
|
||||
End Get
|
||||
Set
|
||||
If (Object.ReferenceEquals(Me.ConnectionStringECMField, value) <> true) Then
|
||||
Me.ConnectionStringECMField = value
|
||||
Me.RaisePropertyChanged("ConnectionStringECM")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<System.Runtime.Serialization.DataMemberAttribute()> _
|
||||
Public Property ConnectionStringIDB() As String
|
||||
Get
|
||||
Return Me.ConnectionStringIDBField
|
||||
End Get
|
||||
Set
|
||||
If (Object.ReferenceEquals(Me.ConnectionStringIDBField, value) <> true) Then
|
||||
Me.ConnectionStringIDBField = value
|
||||
Me.RaisePropertyChanged("ConnectionStringIDB")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<System.Runtime.Serialization.DataMemberAttribute()> _
|
||||
Public Property DocumentTypes() As EDMIServiceReference.GlobalStateDoctype()
|
||||
Get
|
||||
|
||||
@ -156,6 +156,8 @@ Public Class GlobalState
|
||||
_Logger.Debug("ForceDirectDatabaseAccess: {0}", pConfig.ClientConfig.ForceDirectDatabaseAccess)
|
||||
ClientConfig.ForceDirectDatabaseAccess = pConfig.ClientConfig.ForceDirectDatabaseAccess
|
||||
ClientConfig.DocumentTypes = Doctypes
|
||||
ClientConfig.ConnectionStringECM = _MSSQL_ECM.CurrentSQLConnectionString
|
||||
ClientConfig.ConnectionStringIDB = _MSSQL_IDB.CurrentSQLConnectionString
|
||||
End Sub
|
||||
|
||||
Public Class ObjectStore
|
||||
@ -180,6 +182,9 @@ Public Class GlobalState
|
||||
Public Class ClientConfiguration
|
||||
Public Property ForceDirectDatabaseAccess As Boolean = False
|
||||
Public Property DocumentTypes As New List(Of Doctype)
|
||||
|
||||
Public Property ConnectionStringECM As String
|
||||
Public Property ConnectionStringIDB As String
|
||||
End Class
|
||||
|
||||
<DataContract>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user