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