Compare commits
10 Commits
18e8610edc
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de918b1e88 | ||
|
|
298a398067 | ||
|
|
6aebeaa446 | ||
|
|
ed655879f9 | ||
| e598b6faf5 | |||
| 1ad055d958 | |||
| 953cc10416 | |||
| 1615727352 | |||
|
|
857e1366fe | ||
|
|
d3ebc13eae |
@@ -255,6 +255,7 @@ Public Class MSSQLServer
|
||||
|
||||
Return pConnection
|
||||
Catch ex As Exception
|
||||
|
||||
Logger.Error("Error while opening Connection!")
|
||||
Logger.Error(ex)
|
||||
|
||||
@@ -493,14 +494,30 @@ Public Class MSSQLServer
|
||||
pSqlCommandObject.Connection = pSqlConnection
|
||||
pSqlCommandObject.Transaction = oTransaction
|
||||
pSqlCommandObject.CommandTimeout = pTimeout
|
||||
|
||||
' Sicherstellen, dass Nothing-Werte als DBNull übergeben werden
|
||||
For Each oParam As SqlParameter In pSqlCommandObject.Parameters
|
||||
If oParam.Value Is Nothing Then
|
||||
Logger.Warn("ExecuteNonQueryWithConnectionObject: Parameter [{0}] was Nothing - converting to DBNull.Value", oParam.ParameterName)
|
||||
oParam.Value = DBNull.Value
|
||||
End If
|
||||
Next
|
||||
|
||||
pSqlCommandObject.ExecuteNonQuery()
|
||||
|
||||
Return True
|
||||
Catch ex As SqlException
|
||||
Logger.Warn("ExecuteNonQueryWithConnectionObject: SQL Error while executing command: [{0}]", pSqlCommandObject.CommandText)
|
||||
Logger.Warn("Parameters: [{0}]", GetParameterListAsString(pSqlCommandObject))
|
||||
For Each sqlError As SqlError In ex.Errors
|
||||
Logger.Error("SQL Error #{0} (Severity {1}, State {2}, Line {3}): {4}",
|
||||
sqlError.Number, sqlError.Class, sqlError.State, sqlError.LineNumber, sqlError.Message)
|
||||
Next
|
||||
Return False
|
||||
Catch ex As Exception
|
||||
Dim omsg = $"Unexpected Error in ExecuteNonQueryWithConnectionObject while executing command: [{pSqlCommandObject.CommandText}]"
|
||||
Logger.Warn(omsg)
|
||||
Logger.Warn("Unexpected Error in ExecuteNonQueryWithConnectionObject while executing command: [{0}]", pSqlCommandObject.CommandText)
|
||||
Logger.Warn("Parameters: [{0}]", GetParameterListAsString(pSqlCommandObject))
|
||||
Logger.Error(ex)
|
||||
|
||||
Return False
|
||||
Finally
|
||||
MaybeCommitTransaction(oTransaction, pTransactionMode)
|
||||
|
||||
@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
||||
<Assembly: AssemblyCompany("Digital Data")>
|
||||
<Assembly: AssemblyProduct("Modules.Database")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2025")>
|
||||
<Assembly: AssemblyTrademark("2.3.7.0")>
|
||||
<Assembly: AssemblyTrademark("2.4.0.0")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.3.7.0")>
|
||||
<Assembly: AssemblyFileVersion("2.3.7.0")>
|
||||
<Assembly: AssemblyVersion("2.4.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.4.0.0")>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.IO
|
||||
Imports System.ServiceModel
|
||||
Imports System.Threading
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.EDMI.API.Constants
|
||||
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
|
||||
@@ -7,6 +8,7 @@ Imports DigitalData.Modules.EDMI.API.Rights
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class Client
|
||||
Implements IDisposable
|
||||
' Constants
|
||||
Private Const UPDATE_INTERVAL_IN_MINUTES As Integer = 1
|
||||
|
||||
@@ -22,10 +24,59 @@ Public Class Client
|
||||
Private _ClientConfig As GlobalStateClientConfiguration
|
||||
Private _CachedTables As New List(Of String)
|
||||
Private _IsOnline As Boolean
|
||||
' Verhindert parallele Reconnect-Versuche (0 = frei, 1 = läuft)
|
||||
Private _IsReconnecting As Integer = 0
|
||||
Private _Channel As IEDMIServiceChannel
|
||||
|
||||
Private _ClientName As String
|
||||
' Static Registry
|
||||
Private Shared ReadOnly _ActiveClients As New Collections.Concurrent.ConcurrentDictionary(Of String, ClientStatus)
|
||||
Private ReadOnly _ClientId As String ' ← Neu: eindeutiger interner Key
|
||||
Public Shared ReadOnly Property ActiveClients As IReadOnlyDictionary(Of String, ClientStatus)
|
||||
Get
|
||||
Return _ActiveClients
|
||||
End Get
|
||||
End Property
|
||||
''' <summary>
|
||||
''' Returns a snapshot of all currently registered client instances
|
||||
''' </summary>
|
||||
Public Shared Function GetAllClientStatus() As List(Of ClientStatus)
|
||||
Return _ActiveClients.Values.ToList()
|
||||
End Function
|
||||
' Update Timer
|
||||
Private WithEvents UpdateTimer As New Timers.Timer
|
||||
Private _Disposed As Boolean = False
|
||||
|
||||
''' <summary>
|
||||
''' Closes the channel and releases all resources
|
||||
''' </summary>
|
||||
Public Sub Dispose() Implements IDisposable.Dispose
|
||||
Dispose(True)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
Protected Overridable Sub Dispose(disposing As Boolean)
|
||||
If _Disposed Then Return
|
||||
If disposing Then
|
||||
_IsOnline = False ' ← Reconnect-Guard deaktivieren
|
||||
UpdateTimer.Stop()
|
||||
UpdateTimer.Dispose()
|
||||
|
||||
' Auf laufenden Reconnect warten
|
||||
Dim oTimeout = DateTime.Now.AddSeconds(5)
|
||||
While _IsReconnecting = 1 AndAlso DateTime.Now < oTimeout
|
||||
Task.Delay(100).Wait()
|
||||
End While
|
||||
|
||||
If _Channel IsNot Nothing Then
|
||||
Channel.CloseChannel(_Channel)
|
||||
_Channel = Nothing
|
||||
End If
|
||||
|
||||
Dim oRemoved As ClientStatus = Nothing
|
||||
_ActiveClients.TryRemove(_ClientId, oRemoved)
|
||||
Logger.Debug("Client [{0}] unregistered. Total active clients: [{1}]", _ClientName, _ActiveClients.Count)
|
||||
End If
|
||||
_Disposed = True
|
||||
End Sub
|
||||
|
||||
' Public Variables
|
||||
Public ReadOnly Property CachedTables
|
||||
@@ -72,12 +123,15 @@ Public Class Client
|
||||
''' </summary>
|
||||
''' <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)
|
||||
''' <param name="pClientName">Optional identifier for this client instance (e.g. application name or hostname)</param>
|
||||
Public Sub New(pLogConfig As LogConfig, pServiceAdress As String, Optional pClientName As String = "")
|
||||
LogConfig = pLogConfig
|
||||
Logger = pLogConfig.GetLogger()
|
||||
_ClientName = If(String.IsNullOrWhiteSpace(pClientName), Environment.MachineName, pClientName)
|
||||
_ClientId = $"{_ClientName}_{Guid.NewGuid().ToString("N").Substring(0, 8)}" ' ← eindeutig
|
||||
|
||||
UpdateTimer.Interval = 60 * 1000 * UPDATE_INTERVAL_IN_MINUTES
|
||||
UpdateTimer.Start()
|
||||
' Start erfolgt in Connect()
|
||||
|
||||
Try
|
||||
Dim oConnection = New Connection()
|
||||
@@ -85,8 +139,8 @@ Public Class Client
|
||||
ChannelManager = New Channel(pLogConfig, _ServerAddress)
|
||||
AddHandler ChannelManager.Reconnect, AddressOf Reconnect
|
||||
|
||||
Logger.Debug("Ready for connection to Service at: [{0}:{1}]", _ServerAddress.Host, _ServerAddress.Port)
|
||||
|
||||
Logger.Debug("Ready for connection to Service at: [{0}:{1}] | ClientName=[{2}] | ClientId=[{3}]",
|
||||
_ServerAddress.Host, _ServerAddress.Port, _ClientName, _ClientId)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
@@ -98,12 +152,14 @@ Public Class Client
|
||||
''' <param name="pLogConfig">LogConfig object</param>
|
||||
''' <param name="pIPAddress">The IP address to connect to</param>
|
||||
''' <param name="pPortNumber">The Port number to use for the connection</param>
|
||||
Public Sub New(pLogConfig As LogConfig, pIPAddress As String, pPortNumber As Integer)
|
||||
''' <param name="pClientName">Optional identifier for this client instance (e.g. application name or hostname)</param>
|
||||
Public Sub New(pLogConfig As LogConfig, pIPAddress As String, pPortNumber As Integer, Optional pClientName As String = "")
|
||||
LogConfig = pLogConfig
|
||||
Logger = pLogConfig.GetLogger()
|
||||
_ClientName = If(String.IsNullOrWhiteSpace(pClientName), Environment.MachineName, pClientName)
|
||||
_ClientId = $"{_ClientName}_{Guid.NewGuid().ToString("N").Substring(0, 8)}" ' ← eindeutig
|
||||
|
||||
UpdateTimer.Interval = 60 * 1000 * UPDATE_INTERVAL_IN_MINUTES
|
||||
UpdateTimer.Start()
|
||||
|
||||
Try
|
||||
Dim oConnection = New Connection()
|
||||
@@ -111,13 +167,12 @@ Public Class Client
|
||||
ChannelManager = New Channel(pLogConfig, _ServerAddress)
|
||||
AddHandler ChannelManager.Reconnect, AddressOf Reconnect
|
||||
|
||||
Logger.Debug("Ready for connection to Service at: [{0}:{1}]", _ServerAddress.Host, _ServerAddress.Port)
|
||||
|
||||
Logger.Debug("Ready for connection to Service at: [{0}:{1}] | ClientName=[{2}] | ClientId=[{3}]",
|
||||
_ServerAddress.Host, _ServerAddress.Port, _ClientName, _ClientId)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Connect to the service
|
||||
''' </summary>
|
||||
@@ -133,17 +188,32 @@ Public Class Client
|
||||
If oResponse.OK Then
|
||||
_ClientConfig = oResponse.ClientConfig
|
||||
Else
|
||||
Logger.Warn("Client Configuration could not be loaded: [{0}]", oResponse.ErrorMessage)
|
||||
Logger.Warn("⚠Client Configuration could not be loaded: [{0}]", oResponse.ErrorMessage)
|
||||
End If
|
||||
|
||||
Logger.Info($"Connection to AppService [{ServerAddress}] successfully established!")
|
||||
Logger.Info("✔✔Connection to AppService [{0}] successfully established! | Client=[{1}] | Id=[{2}]",
|
||||
ServerAddress, _ClientName, _ClientId)
|
||||
|
||||
_IsOnline = True
|
||||
' CachedTables sofort befüllen – nicht auf den ersten Timer-Tick warten
|
||||
Try
|
||||
Dim oTables As String() = _Channel.GetCachedTables()
|
||||
_CachedTables = oTables.Select(Function(t) t.ToUpper).ToList()
|
||||
Logger.Debug("✔ CachedTables loaded on connect: [{0}]", _CachedTables.Count)
|
||||
Catch ex As Exception
|
||||
Logger.Warn("⚠ CachedTables could not be loaded on connect: {0}", ex.Message)
|
||||
_CachedTables = New List(Of String)
|
||||
End Try
|
||||
|
||||
_IsOnline = True ' ← vor GetStatus()
|
||||
UpdateTimer.Start()
|
||||
|
||||
' In Registry eintragen – jetzt mit korrektem IsOnline=True
|
||||
_ActiveClients(_ClientId) = GetStatus()
|
||||
Logger.Info("Client [{0}] registered with Id=[{1}]. Total active clients: [{2}]", _ClientName, _ClientId, _ActiveClients.Count)
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
_IsOnline = False
|
||||
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
@@ -152,32 +222,99 @@ Public Class Client
|
||||
''' <summary>
|
||||
''' Aborts the channel and creates a new connection
|
||||
''' </summary>
|
||||
Public Sub Reconnect()
|
||||
Logger.Warn("Connection faulted. Trying to reconnect..")
|
||||
Public Async Sub Reconnect(Optional sender As Object = Nothing, Optional e As EventArgs = Nothing)
|
||||
' Nur ein Reconnect gleichzeitig erlauben – atomar prüfen und setzen
|
||||
If Interlocked.CompareExchange(_IsReconnecting, 1, 0) = 1 Then
|
||||
Logger.Debug("Reconnect already in progress – skipping duplicate call.")
|
||||
Return
|
||||
End If
|
||||
|
||||
Try
|
||||
_Channel.Abort()
|
||||
Logger.Warn("⚠ Connection faulted. Trying to reconnect..")
|
||||
|
||||
Dim oRetryDelays = {2, 5, 15, 30}
|
||||
|
||||
For Each oDelay In oRetryDelays
|
||||
Try
|
||||
Await Task.Delay(TimeSpan.FromSeconds(oDelay))
|
||||
Logger.Debug("Reconnect attempt after [{0}]s delay...", oDelay)
|
||||
|
||||
Channel.CloseChannel(_Channel)
|
||||
_Channel = ChannelManager.GetChannel()
|
||||
_Channel.Open()
|
||||
|
||||
_IsOnline = True
|
||||
|
||||
If _ActiveClients.ContainsKey(_ClientId) Then
|
||||
_ActiveClients(_ClientId) = GetStatus()
|
||||
End If
|
||||
|
||||
Logger.Info("✔ Reconnect successful.")
|
||||
Return
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Logger.Warn("⚠ Reconnect failed after [{0}]s: {1}", oDelay, ex.Message)
|
||||
_IsOnline = False
|
||||
End Try
|
||||
Next
|
||||
|
||||
Logger.Error("All reconnect attempts failed. Service unavailable.")
|
||||
Finally
|
||||
' Flag immer zurücksetzen – auch bei unerwarteten Fehlern
|
||||
Interlocked.Exchange(_IsReconnecting, 0)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Async Function UpdateTimer_Elapsed(sender As Object, e As Timers.ElapsedEventArgs) As Task Handles UpdateTimer.Elapsed
|
||||
Private Async Sub UpdateTimer_Elapsed(sender As Object, e As Timers.ElapsedEventArgs) Handles UpdateTimer.Elapsed
|
||||
Try
|
||||
If _Channel Is Nothing OrElse _Channel.State <> CommunicationState.Opened Then
|
||||
Logger.Warn("⚠ UpdateTimer skipped: Channel not in Opened state [{0}]", If(_Channel IsNot Nothing, _Channel.State.ToString(), "null"))
|
||||
_IsOnline = False
|
||||
Reconnect(sender, e)
|
||||
Return
|
||||
End If
|
||||
|
||||
If Not _IsOnline Then
|
||||
Logger.Debug("UpdateTimer skipped: Client is offline.")
|
||||
Return
|
||||
End If
|
||||
|
||||
Dim oTables As String() = Await _Channel.GetCachedTablesAsync()
|
||||
' ◄ NullReferenceException-Schutz: Service kann Nothing zurückgeben
|
||||
If oTables Is Nothing Then
|
||||
Logger.Warn("⚠ UpdateTimer: GetCachedTablesAsync returned Nothing.")
|
||||
_CachedTables = New List(Of String)
|
||||
Return
|
||||
End If
|
||||
_CachedTables = oTables.
|
||||
Select(Function(table) table.ToUpper).
|
||||
ToList()
|
||||
|
||||
Logger.Info("✔ Channel state: [{0}] | Active connections: [{1}] | CachedTables: [{2}]",
|
||||
_Channel.State,
|
||||
Channel.ActiveConnections,
|
||||
_CachedTables.Count)
|
||||
|
||||
If _ActiveClients.ContainsKey(_ClientId) Then
|
||||
_ActiveClients(_ClientId) = GetStatus()
|
||||
End If
|
||||
|
||||
Catch ex As TimeoutException
|
||||
' Stale TCP connection (z.B. Firewall/Citrix Idle-Timeout)
|
||||
Logger.Warn("⚠ UpdateTimer: TCP connection lost (idle timeout / firewall). Triggering reconnect...")
|
||||
_IsOnline = False
|
||||
Reconnect()
|
||||
|
||||
Catch ex As CommunicationException
|
||||
Logger.Warn("⚠ UpdateTimer: Channel faulted. Triggering reconnect...")
|
||||
_IsOnline = False
|
||||
Reconnect()
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Update of CachedTable was not successful!")
|
||||
Logger.Warn("⚠ Update of CachedTable was not successful!")
|
||||
Logger.Error(ex)
|
||||
_CachedTables = New List(Of String)
|
||||
End Try
|
||||
End Function
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Imports a file from a filepath, creating a IDB ObjectId and Filesystem Object
|
||||
@@ -460,7 +597,7 @@ Public Class Client
|
||||
Dim oResult = _Channel.ExecuteNonQuery_MSSQL_IDB(oSql)
|
||||
|
||||
If oResult.OK = False Then
|
||||
Logger.Warn("Error while deleting Term object")
|
||||
Logger.Warn("⚠ Error while IDBNewObjectData")
|
||||
Logger.Error(oResult.ErrorMessage)
|
||||
End If
|
||||
|
||||
@@ -477,7 +614,7 @@ Public Class Client
|
||||
Dim oResult = _Channel.ExecuteNonQuery_MSSQL_IDB(oDELSQL)
|
||||
|
||||
If oResult.OK = False Then
|
||||
Logger.Warn("Error while deleting Term object")
|
||||
Logger.Warn("⚠ Error while deleting Term object")
|
||||
Logger.Error(oResult.ErrorMessage)
|
||||
End If
|
||||
|
||||
@@ -490,268 +627,349 @@ Public Class Client
|
||||
|
||||
#Region "GetDatatable"
|
||||
Public Function GetDatatableFromIDB(pSQL As String) As GetDatatableResponse
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = _Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||
Return _Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableFromIDB))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableFromIDB))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetDatatableFromECM(pSQL As String) As GetDatatableResponse
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = _Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||
Return _Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.ECM
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableFromECM))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableFromECM))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetDatatableFromConnection(pSQL As String, pConnectionId As Integer) As GetDatatableResponse
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = _Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||
Return _Channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.None,
|
||||
.ConnectionId = pConnectionId
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableFromConnection))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableFromConnection))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function GetDatatableFromIDBAsync(pSQL As String) As Task(Of GetDatatableResponse)
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = Await _Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||
Return Await _Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableFromIDBAsync))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableFromIDBAsync))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function GetDatatableFromECMAsync(pSQL As String) As Task(Of GetDatatableResponse)
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = Await _Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||
Logger.Debug("GetDatatableFromECMAsync will be called with SQL [{0}]", pSQL)
|
||||
Return Await _Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.ECM
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableFromECMAsync))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableFromECMAsync))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function GetDatatableFromConnectionAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetDatatableResponse)
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = Await _Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||
Return Await _Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.None,
|
||||
.ConnectionId = pConnectionId
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableFromConnectionAsync))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableFromConnectionAsync))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "GetScalarValue"
|
||||
Public Function GetScalarValueFromIDB(pSQL As String) As GetScalarValueResponse
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = _Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||
Return _Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(GetScalarValueFromIDB))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(GetScalarValueFromIDB))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetScalarValueFromECM(pSQL As String) As GetScalarValueResponse
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = _Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||
Return _Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.ECM
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(GetScalarValueFromECM))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(GetScalarValueFromECM))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetScalarValueFromConnection(pSQL As String, pConnectionId As Integer) As GetScalarValueResponse
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = _Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||
Return _Channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.None,
|
||||
.ConnectionId = pConnectionId
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(GetScalarValueFromConnection))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(GetScalarValueFromConnection))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function GetScalarValueFromIDBAsync(pSQL As String) As Task(Of GetScalarValueResponse)
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = Await _Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||
Return Await _Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(GetScalarValueFromIDBAsync))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(GetScalarValueFromIDBAsync))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function GetScalarValueFromECMAsync(pSQL As String) As Task(Of GetScalarValueResponse)
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = Await _Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||
Return Await _Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.ECM
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(GetScalarValueFromECMAsync))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(GetScalarValueFromECMAsync))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function GetScalarValueFromConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of GetScalarValueResponse)
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = Await _Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||
Return Await _Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.None,
|
||||
.ConnectionId = pConnectionId
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(GetScalarValueFromConnectionAsync))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(GetScalarValueFromConnectionAsync))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "ExecuteNonQuery"
|
||||
Public Function ExecuteNonQueryFromIDB(pSQL As String) As ExecuteNonQueryResponse
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = _Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||
Return _Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(ExecuteNonQueryFromIDB))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(ExecuteNonQueryFromIDB))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ExecuteNonQueryFromECM(pSQL As String) As ExecuteNonQueryResponse
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = _Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||
Return _Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.ECM
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(ExecuteNonQueryFromECM))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(ExecuteNonQueryFromECM))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ExecuteNonQueryFromConnection(pSQL As String, pConnectionId As Integer) As ExecuteNonQueryResponse
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = _Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||
Return _Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.None,
|
||||
.ConnectionId = pConnectionId
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(ExecuteNonQueryFromConnection))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(ExecuteNonQueryFromConnection))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function ExecuteNonQueryFromIDBAsync(pSQL As String) As Task(Of ExecuteNonQueryResponse)
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = Await _Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||
Return Await _Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(ExecuteNonQueryFromIDBAsync))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(ExecuteNonQueryFromIDBAsync))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function ExecuteNonQueryFromECMAsync(pSQL As String) As Task(Of ExecuteNonQueryResponse)
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = Await _Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||
Return Await _Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.ECM
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(ExecuteNonQueryFromECMAsync))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(ExecuteNonQueryFromECMAsync))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function ExecuteNonQueryFromConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of ExecuteNonQueryResponse)
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = Await _Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||
Return Await _Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.None,
|
||||
.ConnectionId = pConnectionId
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(ExecuteNonQueryFromConnectionAsync))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(ExecuteNonQueryFromConnectionAsync))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
Public Function GetDatatableByName(DatatableName As String, Optional FilterExpression As String = "", Optional SortByColumn As String = "") As TableResult
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = _Channel.ReturnDatatableFromCache(DatatableName, FilterExpression, SortByColumn)
|
||||
Return oResponse
|
||||
Return _Channel.ReturnDatatableFromCache(DatatableName, FilterExpression, SortByColumn)
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableByName))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableByName))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function GetDatatableByNameAsync(DatatableName As String, Optional FilterExpression As String = "", Optional SortByColumn As String = "") As Task(Of TableResult)
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Dim oResponse = Await _Channel.ReturnDatatableFromCacheAsync(DatatableName, FilterExpression, SortByColumn)
|
||||
Return oResponse
|
||||
Return Await _Channel.ReturnDatatableFromCacheAsync(DatatableName, FilterExpression, SortByColumn)
|
||||
Catch ex As EndpointNotFoundException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableByNameAsync))
|
||||
Catch ex As CommunicationException
|
||||
HandleCommunicationError(ex, NameOf(GetDatatableByNameAsync))
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
@@ -777,15 +995,15 @@ Public Class Client
|
||||
|
||||
Catch ex As FaultException(Of ObjectDoesNotExistFault)
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
|
||||
Catch ex As FaultException
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
|
||||
End Try
|
||||
End Function
|
||||
@@ -804,10 +1022,21 @@ Public Class Client
|
||||
}
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
''' <summary>
|
||||
''' Returns a live monitoring snapshot from the service (active sessions, users)
|
||||
''' </summary>
|
||||
Public Function GetServiceStatus() As ServiceStatusResponse
|
||||
EnsureAvailable()
|
||||
Try
|
||||
Return _Channel.GetServiceStatus()
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region "Private Functions"
|
||||
|
||||
@@ -819,6 +1048,55 @@ Public Class Client
|
||||
Private Function GetUserName(pOverrideName) As String
|
||||
Return ObjectEx.NotNull(pOverrideName, Environment.UserName)
|
||||
End Function
|
||||
''' <summary>
|
||||
''' Throws InvalidOperationException if the channel is not ready for calls
|
||||
''' </summary>
|
||||
Private Sub EnsureAvailable()
|
||||
If _Channel Is Nothing Then
|
||||
Throw New InvalidOperationException("Channel is not initialized. Call Connect() first.")
|
||||
End If
|
||||
|
||||
If Not _IsOnline Then
|
||||
' Kurze Grace-Period abwarten, damit Reconnect() seinen _IsReconnecting-Flag setzen kann
|
||||
Dim oGraceLimit = DateTime.Now.AddMilliseconds(600)
|
||||
While DateTime.Now < oGraceLimit AndAlso _IsReconnecting = 0 AndAlso Not _IsOnline
|
||||
Task.Delay(100).Wait()
|
||||
End While
|
||||
|
||||
' Jetzt auf aktiven Reconnect warten
|
||||
Dim oWaitLimit = DateTime.Now.AddSeconds(10)
|
||||
While Not _IsOnline AndAlso DateTime.Now < oWaitLimit AndAlso _IsReconnecting = 1
|
||||
Task.Delay(500).Wait()
|
||||
Logger.Debug("EnsureAvailable: Waiting for reconnect... Channel=[{0}]", _Channel.State.ToString())
|
||||
End While
|
||||
|
||||
If Not _IsOnline Then
|
||||
Throw New InvalidOperationException("Client is offline.")
|
||||
End If
|
||||
End If
|
||||
|
||||
If _Channel.State <> CommunicationState.Opened Then
|
||||
Throw New InvalidOperationException($"Channel is not available. State=[{_Channel.State}]")
|
||||
End If
|
||||
End Sub
|
||||
''' <summary>
|
||||
''' Logs the communication error, sets offline state, triggers reconnect and rethrows
|
||||
''' </summary>
|
||||
Private Sub HandleCommunicationError(ex As Exception, callerName As String)
|
||||
Select Case True
|
||||
Case TypeOf ex Is EndpointNotFoundException
|
||||
Logger.Warn("⚠ Service not reachable (EndpointNotFoundException in [{0}]). Triggering reconnect...", callerName)
|
||||
Case TypeOf ex Is CommunicationException
|
||||
Logger.Warn("⚠ CommunicationException in [{0}] during call. Triggering reconnect...", callerName)
|
||||
Case Else
|
||||
Logger.Warn("⚠ Unexpected exception in [{0}] during call. Triggering reconnect...", callerName)
|
||||
Logger.Error(ex)
|
||||
End Select
|
||||
|
||||
_IsOnline = False
|
||||
Reconnect()
|
||||
Throw ex
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "Response Classes"
|
||||
@@ -887,34 +1165,74 @@ Public Class Client
|
||||
Select Case Type
|
||||
Case AttributeTypeName.VECTOR_INTEGER
|
||||
Return ValueBigInt
|
||||
|
||||
Case AttributeTypeName.BIG_INTEGER
|
||||
Return ValueBigInt
|
||||
|
||||
Case AttributeTypeName.VECTOR_STRING
|
||||
Return ValueText
|
||||
|
||||
Case AttributeTypeName.VARCHAR
|
||||
Return ValueText
|
||||
|
||||
Case AttributeTypeName.BIT
|
||||
Return IIf(ValueBigInt = 1, True, False)
|
||||
|
||||
Case AttributeTypeName.DATE
|
||||
Return ValueDate
|
||||
|
||||
Case AttributeTypeName.DATETIME
|
||||
Return ValueDate
|
||||
|
||||
Case AttributeTypeName.DECIMAL
|
||||
Return ValueDecimal
|
||||
|
||||
Case AttributeTypeName.FLOAT
|
||||
Return ValueDecimal
|
||||
|
||||
Case Else
|
||||
Return Nothing
|
||||
End Select
|
||||
End Function
|
||||
End Class
|
||||
End Class ' ← ObjectAttribute endet hier
|
||||
''' <summary>
|
||||
''' Returns a detailed status snapshot of the current client state
|
||||
''' </summary>
|
||||
Public Function GetStatus() As ClientStatus
|
||||
Return New ClientStatus() With {
|
||||
.IsOnline = _IsOnline,
|
||||
.ClientId = _ClientId, ' ← Neu
|
||||
.ClientName = _ClientName,
|
||||
.ServerAddress = Me.ServerAddress,
|
||||
.ChannelState = If(_Channel IsNot Nothing, _Channel.State.ToString(), "null"),
|
||||
.ActiveConnections = Channel.ActiveConnections,
|
||||
.CachedTableCount = _CachedTables.Count,
|
||||
.CachedTables = _CachedTables.ToList(),
|
||||
.HasClientConfig = _ClientConfig IsNot Nothing,
|
||||
.IsDisposed = _Disposed,
|
||||
.TimerEnabled = UpdateTimer.Enabled,
|
||||
.TimerIntervalSeconds = CInt(UpdateTimer.Interval / 1000),
|
||||
.Timestamp = DateTime.Now
|
||||
}
|
||||
End Function
|
||||
|
||||
Public Class ClientStatus
|
||||
Public Property IsOnline As Boolean
|
||||
Public Property ClientId As String
|
||||
Public Property ClientName As String
|
||||
Public Property ServerAddress As String
|
||||
Public Property ChannelState As String
|
||||
Public Property ActiveConnections As Integer
|
||||
Public Property CachedTableCount As Integer
|
||||
Public Property CachedTables As List(Of String)
|
||||
Public Property HasClientConfig As Boolean
|
||||
Public Property IsDisposed As Boolean
|
||||
Public Property TimerEnabled As Boolean
|
||||
Public Property TimerIntervalSeconds As Integer
|
||||
Public Property Timestamp As DateTime
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return String.Format(
|
||||
"[ClientStatus] ClientName=[{0}] Id=[{1}] Online=[{2}] Channel=[{3}]",
|
||||
ClientName, ClientId, IsOnline, ChannelState)
|
||||
End Function
|
||||
|
||||
Public Function Client_Who_ToString() As String
|
||||
Return String.Format(
|
||||
"[ClientStatus] Client=[{0}] Id=[{1}] Online=[{2}] Server=[{3}] Channel=[{4}]",
|
||||
ClientName, ClientId, IsOnline, ServerAddress, ChannelState)
|
||||
End Function
|
||||
End Class ' ← ClientStatus endet hier – kein GetServiceStatus mehr drin
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.ServiceModel
|
||||
Imports System.Threading
|
||||
Imports System.Xml
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
|
||||
@@ -10,13 +11,26 @@ Public Class Channel
|
||||
Private ReadOnly ChannelFactory As ChannelFactory(Of IEDMIServiceChannel)
|
||||
|
||||
Public Event Reconnect As EventHandler
|
||||
' Verbindungszähler
|
||||
Private Shared _ActiveConnections As Integer = 0
|
||||
Public Shared ReadOnly Property ActiveConnections As Integer
|
||||
Get
|
||||
Return _ActiveConnections
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared Function GetBinding(Optional AuthenticationMode As TcpClientCredentialType = TcpClientCredentialType.Windows) As NetTcpBinding
|
||||
Return New NetTcpBinding() With {
|
||||
.MaxReceivedMessageSize = Constants.ChannelSettings.MAX_RECEIVED_MESSAGE_SIZE,
|
||||
.MaxBufferSize = Constants.ChannelSettings.MAX_BUFFER_SIZE,
|
||||
.MaxBufferPoolSize = Constants.ChannelSettings.MAX_BUFFER_POOL_SIZE,
|
||||
.ListenBacklog = Constants.ChannelSettings.MAX_CONNECTIONS,
|
||||
.MaxConnections = Constants.ChannelSettings.MAX_CONNECTIONS,
|
||||
.TransferMode = TransferMode.Streamed,
|
||||
.SendTimeout = TimeSpan.FromSeconds(30), ' ← War: 5min → Schnellere Fehlererkennung
|
||||
.ReceiveTimeout = TimeSpan.FromMinutes(10), ' Keepalive < Firewall-Timeout (3600s) ✓
|
||||
.OpenTimeout = TimeSpan.FromSeconds(30), ' ← Neu: Verbindungsaufbau begrenzen
|
||||
.CloseTimeout = TimeSpan.FromSeconds(30),
|
||||
.Security = New NetTcpSecurity() With {
|
||||
.Mode = SecurityMode.Transport,
|
||||
.Transport = New TcpTransportSecurity() With {
|
||||
@@ -34,7 +48,28 @@ Public Class Channel
|
||||
MyBase.New(pLogConfig)
|
||||
ChannelFactory = GetChannelFactory(pServerAddress)
|
||||
End Sub
|
||||
''' <summary>
|
||||
''' Closes a channel gracefully, falls back to Abort on error
|
||||
''' </summary>
|
||||
Public Shared Sub CloseChannel(pChannel As IEDMIServiceChannel)
|
||||
If pChannel Is Nothing Then Return
|
||||
|
||||
Try
|
||||
If pChannel.State = CommunicationState.Opened Then
|
||||
pChannel.Close()
|
||||
ElseIf pChannel.State = CommunicationState.Faulted OrElse
|
||||
pChannel.State = CommunicationState.Closing Then
|
||||
pChannel.Abort()
|
||||
End If
|
||||
' CommunicationState.Created / Closed → nichts tun, Zähler nicht betroffen
|
||||
Catch ex As Exception
|
||||
Try
|
||||
pChannel.Abort()
|
||||
Catch
|
||||
' Ignore
|
||||
End Try
|
||||
End Try
|
||||
End Sub
|
||||
''' <summary>
|
||||
''' Creates a channel and adds a Faulted-Handler
|
||||
''' </summary>
|
||||
@@ -44,21 +79,45 @@ Public Class Channel
|
||||
Logger.Debug("Creating channel.")
|
||||
Dim oChannel = ChannelFactory.CreateChannel()
|
||||
|
||||
AddHandler oChannel.Faulted, Sub() RaiseEvent Reconnect(Me, Nothing)
|
||||
' Verbindung zählen beim Öffnen
|
||||
AddHandler oChannel.Opened, Sub()
|
||||
Dim oCount = Interlocked.Increment(_ActiveConnections)
|
||||
Logger.Debug("Channel opened. Active connections: [{0}]", oCount)
|
||||
End Sub
|
||||
|
||||
' Verbindung abziehen beim Schließen oder Fehler
|
||||
AddHandler oChannel.Closed, Sub()
|
||||
Dim oCount = Interlocked.Decrement(_ActiveConnections)
|
||||
Logger.Debug("Channel closed. Active connections: [{0}]", oCount)
|
||||
End Sub
|
||||
|
||||
AddHandler oChannel.Faulted, Sub()
|
||||
Dim oCount = Interlocked.Decrement(_ActiveConnections)
|
||||
Logger.Warn("Channel faulted. Active connections: [{0}]", oCount)
|
||||
RaiseEvent Reconnect(Me, Nothing)
|
||||
End Sub
|
||||
|
||||
Logger.Debug("Channel created. State=[{0}]", oChannel.State)
|
||||
Return oChannel
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function GetChannelFactory(pServerAddress As ServerAddressStruct) As ChannelFactory(Of IEDMIServiceChannel)
|
||||
Dim oBinding = GetBinding()
|
||||
Dim oAddress = New EndpointAddress($"net.tcp://{pServerAddress.Host}:{pServerAddress.Port}/DigitalData/Services/Main")
|
||||
Logger.Debug("Creating ChannelFactory with Binding: SendTimeout=[{0}], ReceiveTimeout=[{1}], MaxConnections=[{2}], MaxBufferSize=[{3}], TransferMode=[{4}]",
|
||||
oBinding.SendTimeout,
|
||||
oBinding.ReceiveTimeout,
|
||||
oBinding.MaxConnections,
|
||||
oBinding.MaxBufferSize,
|
||||
oBinding.TransferMode)
|
||||
Dim oFactory = New ChannelFactory(Of IEDMIServiceChannel)(oBinding, oAddress)
|
||||
Return oFactory
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports System.Data.SqlClient
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.EDMI.API
|
||||
Imports DigitalData.Modules.EDMI.API.Constants
|
||||
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
|
||||
@@ -78,7 +79,7 @@ Public Class DatabaseWithFallback
|
||||
End Function
|
||||
|
||||
Public Async Function GetDatatableECMAsync(pSQL As String) As Task(Of DataTable)
|
||||
Return Await Task.Run(Function() GetDatatableECM(pSQL))
|
||||
Return Await GetDatatableFromServiceAsync(pSQL, Constants.DatabaseType.ECM, 0)
|
||||
End Function
|
||||
|
||||
Public Function GetDatatableIDB(pSQL As String) As DataTable
|
||||
@@ -86,7 +87,7 @@ Public Class DatabaseWithFallback
|
||||
End Function
|
||||
|
||||
Public Async Function GetDatatableIDBAsync(pSQL As String) As Task(Of DataTable)
|
||||
Return Await Task.Run(Function() GetDatatableIDB(pSQL))
|
||||
Return Await GetDatatableFromServiceAsync(pSQL, Constants.DatabaseType.IDB, 0)
|
||||
End Function
|
||||
|
||||
Public Function GetDatatableWithConnection(pSQL As String, pConnectionId As Integer) As DataTable
|
||||
@@ -94,7 +95,7 @@ Public Class DatabaseWithFallback
|
||||
End Function
|
||||
|
||||
Public Async Function GetDatatableWithConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of DataTable)
|
||||
Return Await Task.Run(Function() GetDatatableWithConnection(pSQL, pConnectionId))
|
||||
Return Await GetDatatableFromServiceAsync(pSQL, Constants.DatabaseType.None, pConnectionId)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
@@ -104,7 +105,7 @@ Public Class DatabaseWithFallback
|
||||
End Function
|
||||
|
||||
Public Async Function GetScalarValueECMAsync(pSQL As String) As Task(Of Object)
|
||||
Return Await Task.Run(Function() GetScalarValueECM(pSQL))
|
||||
Return Await GetScalarValueFromServiceAsync(pSQL, Constants.DatabaseType.ECM, 0)
|
||||
End Function
|
||||
|
||||
Public Function GetScalarValueIDB(pSQL As String) As Object
|
||||
@@ -112,7 +113,7 @@ Public Class DatabaseWithFallback
|
||||
End Function
|
||||
|
||||
Public Async Function GetScalarValueIDBAsync(pSQL As String) As Task(Of Object)
|
||||
Return Await Task.Run(Function() GetScalarValueIDB(pSQL))
|
||||
Return Await GetScalarValueFromServiceAsync(pSQL, Constants.DatabaseType.IDB, 0)
|
||||
End Function
|
||||
|
||||
Public Function GetScalarValueWithConnection(pSQL As String, pConnectionId As Integer) As Object
|
||||
@@ -120,7 +121,7 @@ Public Class DatabaseWithFallback
|
||||
End Function
|
||||
|
||||
Public Async Function GetScalarValueWithConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of Object)
|
||||
Return Await Task.Run(Function() GetScalarValueWithConnection(pSQL, pConnectionId))
|
||||
Return Await GetScalarValueFromServiceAsync(pSQL, Constants.DatabaseType.None, pConnectionId)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
@@ -130,7 +131,7 @@ Public Class DatabaseWithFallback
|
||||
End Function
|
||||
|
||||
Public Async Function ExecuteNonQueryECMAsync(pSQL As String) As Task(Of Boolean)
|
||||
Return Await Task.Run(Function() ExecuteNonQueryECM(pSQL))
|
||||
Return Await ExecuteNonQueryFromServiceAsync(pSQL, Constants.DatabaseType.ECM, 0)
|
||||
End Function
|
||||
|
||||
Public Function ExecuteNonQueryIDB(pSQL As String) As Boolean
|
||||
@@ -138,7 +139,7 @@ Public Class DatabaseWithFallback
|
||||
End Function
|
||||
|
||||
Public Async Function ExecuteNonQueryIDBAsync(pSQL As String) As Task(Of Boolean)
|
||||
Return Await Task.Run(Function() ExecuteNonQueryIDB(pSQL))
|
||||
Return Await ExecuteNonQueryFromServiceAsync(pSQL, Constants.DatabaseType.IDB, 0)
|
||||
End Function
|
||||
|
||||
Public Function ExecuteNonQueryWithConnection(pSQL As String, pConnectionId As Integer) As Boolean
|
||||
@@ -146,7 +147,7 @@ Public Class DatabaseWithFallback
|
||||
End Function
|
||||
|
||||
Public Async Function ExecuteNonQueryWithConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of Boolean)
|
||||
Return Await Task.Run(Function() ExecuteNonQueryWithConnection(pSQL, pConnectionId))
|
||||
Return Await ExecuteNonQueryFromServiceAsync(pSQL, Constants.DatabaseType.None, pConnectionId)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
@@ -187,33 +188,34 @@ Public Class DatabaseWithFallback
|
||||
Try
|
||||
Dim oResult As DataTable = Nothing
|
||||
Dim oTableResult As TableResult = Nothing
|
||||
|
||||
_Logger.Debug("GetDatatable: Fetching datatable [{0}] , Filter Expression [{1}], Sort By Column [{2}], Force Fallback [{3}]",
|
||||
pDataTableName, pFilterExpression, pSortByColumn, pForceFallback)
|
||||
' If there is no client, we assume there is no service (configured)
|
||||
If _Client Is Nothing Then
|
||||
_Logger.Debug("Client is empty, falling back to direct database access.")
|
||||
_Logger.Debug("GetDatatable: Client is empty, falling back to direct database access.")
|
||||
Return GetDatatableFromDatabase(pFallbackSQL, pFallbackType, pConnectionId)
|
||||
End If
|
||||
|
||||
' If ForceFallback flag is set, we go to database immediately
|
||||
If pForceFallback Or _ClientConfig.ForceDirectDatabaseAccess Then
|
||||
_Logger.Debug("ForceFallback is True, falling back to direct database access.")
|
||||
_Logger.Debug("GetDatatable: ForceFallback is True, falling back to direct database access.")
|
||||
Return GetDatatableFromDatabase(pFallbackSQL, pFallbackType, pConnectionId)
|
||||
End If
|
||||
|
||||
' If the table is not cached, we try going through the service
|
||||
If Not IsTableCached(pDataTableName) Then
|
||||
_Logger.Debug("Datatable is not chached, fetching data from service.")
|
||||
_Logger.Debug("GetDatatable: Datatable [{0}] is not chached, fetching data from service.", pDataTableName)
|
||||
Return GetDatatableFromService(pFallbackSQL, pFallbackType, pConnectionId)
|
||||
End If
|
||||
|
||||
' If there is a proper ConnectionId, we try going through the service
|
||||
If pConnectionId > 0 Then
|
||||
_Logger.Debug("ConnectionId is set, fetching data from service.")
|
||||
_Logger.Debug("GetDatatable: ConnectionId is set, fetching data from service.")
|
||||
Return GetDatatableFromService(pFallbackSQL, pFallbackType, pConnectionId)
|
||||
End If
|
||||
|
||||
Try
|
||||
_Logger.Debug("Datatable is chached, fetching data from cache.")
|
||||
_Logger.Debug("GetDatatable: Datatable is chached, fetching data from cache.")
|
||||
oTableResult = _Client.GetDatatableByName(pDataTableName, pFilterExpression, pSortByColumn)
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
@@ -221,9 +223,10 @@ Public Class DatabaseWithFallback
|
||||
End Try
|
||||
|
||||
If oTableResult Is Nothing OrElse oTableResult.OK = False Then
|
||||
_Logger.Warn("Datatable [{0}] could not be fetched from AppServer Cache. Falling back to direct Database Access.", pDataTableName)
|
||||
_Logger.Warn("⚠ GetDatatable: Datatable [{0}] could not be fetched from AppServer Cache. Falling back to direct Database Access.", pDataTableName)
|
||||
Return GetDatatableFromDatabase(pFallbackSQL, pFallbackType, pConnectionId)
|
||||
Else
|
||||
_Logger.Debug("✔ GetDatatable: Datatable [{0}] fetched from AppServer Cache.", pDataTableName)
|
||||
Return oTableResult.Table
|
||||
End If
|
||||
|
||||
@@ -276,11 +279,13 @@ Public Class DatabaseWithFallback
|
||||
|
||||
' If there is no client, we assume there is no service (configured)
|
||||
If _Client Is Nothing Then
|
||||
_Logger.Debug("ExecuteNonQuery - Client is empty, falling back to direct database access.")
|
||||
Return ExecuteNonQueryFromDatabase(pSQL, pDatabaseType, pConnectionId)
|
||||
End If
|
||||
|
||||
' If ForceFallback flag is set, we go to database immediately
|
||||
If pForceFallback Or _ClientConfig.ForceDirectDatabaseAccess Then
|
||||
_Logger.Debug("ExecuteNonQuery - ForceFallback is set, falling back to direct database access.")
|
||||
Return ExecuteNonQueryFromDatabase(pSQL, pDatabaseType, pConnectionId)
|
||||
End If
|
||||
|
||||
@@ -294,7 +299,9 @@ Public Class DatabaseWithFallback
|
||||
End Function
|
||||
|
||||
Private Function IsTableCached(pName As String) As Boolean
|
||||
_Logger.Debug("IsTableCached: Checking if table [{0}] is cached.", pName)
|
||||
If _Client Is Nothing Then
|
||||
_Logger.Warn("⚠ IsTableCached: Client is nothing, cannot check if table is cached.")
|
||||
Return False
|
||||
End If
|
||||
|
||||
@@ -303,42 +310,74 @@ Public Class DatabaseWithFallback
|
||||
|
||||
Private Function GetDatatableFromService(pSQLCommand As String, DatabaseType As Constants.DatabaseType, pConnectionId As Integer) As DataTable
|
||||
Try
|
||||
_Logger.Debug("GetDatatableFromService: Fetching data from service [{0}] with Connection Id [{1}] and Command [{2}]", DatabaseType.ToString, pConnectionId, pSQLCommand)
|
||||
Dim oResult As GetDatatableResponse = Nothing
|
||||
|
||||
Select Case DatabaseType
|
||||
Case Constants.DatabaseType.ECM
|
||||
oResult = _Client.GetDatatableFromECM(pSQLCommand)
|
||||
|
||||
Case Constants.DatabaseType.IDB
|
||||
oResult = _Client.GetDatatableFromIDB(pSQLCommand)
|
||||
|
||||
Case Else
|
||||
Return GetDatatableFromDatabase(pSQLCommand, DatabaseType, pConnectionId)
|
||||
|
||||
End Select
|
||||
|
||||
If oResult Is Nothing Then
|
||||
Throw New ApplicationException("Unexpected server error ocurred!")
|
||||
End If
|
||||
|
||||
If oResult.OK = False Then
|
||||
Throw New ApplicationException(oResult.ErrorMessage)
|
||||
If oResult Is Nothing OrElse oResult.OK = False Then
|
||||
_Logger.Warn("⚠ GetDatatableFromService: Service returned invalid response [{0}]. Falling back to direct database access.", If(oResult Is Nothing, "null", oResult.ErrorMessage))
|
||||
Return GetDatatableFromDatabase(pSQLCommand, DatabaseType, pConnectionId)
|
||||
End If
|
||||
|
||||
Return oResult.Table
|
||||
|
||||
Catch ex As InvalidOperationException
|
||||
_Logger.Warn("⚠ GetDatatableFromService skipped: [{0}] Falling back to direct database access.", ex.Message)
|
||||
Return GetDatatableFromDatabase(pSQLCommand, DatabaseType, pConnectionId)
|
||||
|
||||
Catch ex As Exception
|
||||
_Logger.Warn("GetDatatableFromService failed. Falling back to direct database access.")
|
||||
_Logger.Warn("⚠ GetDatatableFromService failed. Falling back to direct database access.")
|
||||
_Logger.Error(ex)
|
||||
Return GetDatatableFromDatabase(pSQLCommand, DatabaseType, pConnectionId)
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Async Function GetDatatableFromServiceAsync(pSQLCommand As String, DatabaseType As Constants.DatabaseType, pConnectionId As Integer) As Task(Of DataTable)
|
||||
Dim oFallback As Boolean = False
|
||||
_Logger.Debug("GetDatatableFromServiceAsync: GetDatatableFromServiceAsync called with SQL [{0}], DatabaseType [{1}], ConnectionId [{2}]", pSQLCommand, DatabaseType.ToString, pConnectionId)
|
||||
If _Client Is Nothing OrElse _ClientConfig?.ForceDirectDatabaseAccess Then
|
||||
Return Await Task.Run(Function() GetDatatableFromDatabase(pSQLCommand, DatabaseType, pConnectionId))
|
||||
End If
|
||||
|
||||
Dim oResult As GetDatatableResponse = Nothing
|
||||
Try
|
||||
Select Case DatabaseType
|
||||
Case Constants.DatabaseType.ECM
|
||||
oResult = Await _Client.GetDatatableFromECMAsync(pSQLCommand)
|
||||
Case Constants.DatabaseType.IDB
|
||||
oResult = Await _Client.GetDatatableFromIDBAsync(pSQLCommand)
|
||||
Case Else
|
||||
oResult = Await _Client.GetDatatableFromConnectionAsync(pSQLCommand, pConnectionId)
|
||||
End Select
|
||||
|
||||
If oResult Is Nothing OrElse oResult.OK = False Then
|
||||
_Logger.Warn("⚠ GetDatatableFromServiceAsync failed. Falling back to direct database access.")
|
||||
oFallback = True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Warn("⚠ GetDatatableFromServiceAsync failed. Falling back to direct database access.")
|
||||
_Logger.Error(ex)
|
||||
oFallback = True
|
||||
End Try
|
||||
|
||||
If oFallback Then
|
||||
Return Await Task.Run(Function() GetDatatableFromDatabase(pSQLCommand, DatabaseType, pConnectionId))
|
||||
End If
|
||||
|
||||
Return oResult.Table
|
||||
End Function
|
||||
Private Function GetDatatableFromDatabase(pSQLCommand As String, pDatabaseType As Constants.DatabaseType, pConnectionId As Integer) As DataTable
|
||||
Try
|
||||
_Logger.Debug("Fetching data from database [{0}] with Connection Id [{0}]", pDatabaseType.ToString, pConnectionId)
|
||||
_Logger.Debug("GetDatatableFromDatabase: Fetching data from database [{0}] with Connection Id [{1}] and Command [{2}]", pDatabaseType.ToString, pConnectionId, pSQLCommand)
|
||||
|
||||
Select Case pDatabaseType
|
||||
Case Constants.DatabaseType.IDB
|
||||
@@ -361,35 +400,68 @@ Public Class DatabaseWithFallback
|
||||
|
||||
End Try
|
||||
End Function
|
||||
Private Async Function GetScalarValueFromServiceAsync(pSQLCommand As String, DatabaseType As Constants.DatabaseType, pConnectionId As Integer) As Task(Of Object)
|
||||
Dim oFallback As Boolean = False
|
||||
|
||||
_Logger.Debug("GetScalarValueFromServiceAsync called with SQL [{0}], DatabaseType [{1}], ConnectionId [{2}]", pSQLCommand, DatabaseType.ToString, pConnectionId)
|
||||
|
||||
If _Client Is Nothing OrElse _ClientConfig?.ForceDirectDatabaseAccess Then
|
||||
Return Await Task.Run(Function() GetScalarValueFromDatabase(pSQLCommand, DatabaseType, pConnectionId))
|
||||
End If
|
||||
|
||||
Dim oResult As GetScalarValueResponse = Nothing
|
||||
Try
|
||||
Select Case DatabaseType
|
||||
Case Constants.DatabaseType.ECM
|
||||
oResult = Await _Client.GetScalarValueFromECMAsync(pSQLCommand)
|
||||
Case Constants.DatabaseType.IDB
|
||||
oResult = Await _Client.GetScalarValueFromIDBAsync(pSQLCommand)
|
||||
Case Else
|
||||
oResult = Await _Client.GetScalarValueFromConnectionAsync(pSQLCommand, pConnectionId)
|
||||
End Select
|
||||
|
||||
If oResult Is Nothing OrElse oResult.OK = False Then
|
||||
_Logger.Warn("⚠ GetScalarValueFromServiceAsync failed. Falling back to direct database access.")
|
||||
oFallback = True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Warn("⚠ GetScalarValueFromServiceAsync failed. Falling back to direct database access.")
|
||||
_Logger.Error(ex)
|
||||
oFallback = True
|
||||
End Try
|
||||
|
||||
If oFallback Then
|
||||
Return Await Task.Run(Function() GetScalarValueFromDatabase(pSQLCommand, DatabaseType, pConnectionId))
|
||||
End If
|
||||
|
||||
Return oResult.Scalar
|
||||
End Function
|
||||
Private Function GetScalarValueFromService(pSQLCommand As String, DatabaseType As Constants.DatabaseType, pConnectionId As Integer) As Object
|
||||
Try
|
||||
Dim oResult As GetScalarValueResponse = Nothing
|
||||
|
||||
_Logger.Debug("GetScalarValueFromService [{0}] with Connection Id [{1}] and Command [{2}]", DatabaseType.ToString, pConnectionId, pSQLCommand)
|
||||
Select Case DatabaseType
|
||||
Case Constants.DatabaseType.ECM
|
||||
oResult = _Client.GetScalarValueFromECM(pSQLCommand)
|
||||
|
||||
Case Constants.DatabaseType.IDB
|
||||
oResult = _Client.GetScalarValueFromIDB(pSQLCommand)
|
||||
|
||||
Case Else
|
||||
Return GetScalarValueFromDatabase(pSQLCommand, DatabaseType, pConnectionId)
|
||||
|
||||
End Select
|
||||
|
||||
If oResult Is Nothing Then
|
||||
Throw New ApplicationException("Unexpected server error ocurred!")
|
||||
End If
|
||||
|
||||
If oResult.OK = False Then
|
||||
Throw New ApplicationException(oResult.ErrorMessage)
|
||||
If oResult Is Nothing OrElse oResult.OK = False Then
|
||||
_Logger.Warn("⚠ GetScalarValueFromService: Service returned invalid response [{0}]. Falling back to direct database access.", If(oResult Is Nothing, "null", oResult.ErrorMessage))
|
||||
Return GetScalarValueFromDatabase(pSQLCommand, DatabaseType, pConnectionId)
|
||||
End If
|
||||
|
||||
Return oResult.Scalar
|
||||
|
||||
Catch ex As InvalidOperationException
|
||||
_Logger.Warn("⚠ GetScalarValueFromService skipped: [{0}] Falling back to direct database access.", ex.Message)
|
||||
Return GetScalarValueFromDatabase(pSQLCommand, DatabaseType, pConnectionId)
|
||||
|
||||
Catch ex As Exception
|
||||
_Logger.Warn("GetScalarValueFromService failed. Falling back to direct database access.")
|
||||
_Logger.Warn("⚠ GetScalarValueFromService failed. Falling back to direct database access.")
|
||||
_Logger.Error(ex)
|
||||
Return GetScalarValueFromDatabase(pSQLCommand, DatabaseType, pConnectionId)
|
||||
|
||||
@@ -399,6 +471,7 @@ Public Class DatabaseWithFallback
|
||||
|
||||
Private Function GetScalarValueFromDatabase(pSQLCommand As String, DatabaseType As Constants.DatabaseType, pConnectionId As Integer) As Object
|
||||
Try
|
||||
_Logger.Debug("DBwFF GetScalarValueFromDatabase [{0}] with Connection Id [{1}] and Command [{2}]", DatabaseType.ToString, pConnectionId, pSQLCommand)
|
||||
Select Case DatabaseType
|
||||
Case Constants.DatabaseType.IDB
|
||||
Return _DatabaseIDB.GetScalarValue(pSQLCommand)
|
||||
@@ -419,35 +492,68 @@ Public Class DatabaseWithFallback
|
||||
|
||||
End Try
|
||||
End Function
|
||||
Private Async Function ExecuteNonQueryFromServiceAsync(pSQLCommand As String, DatabaseType As Constants.DatabaseType, pConnectionId As Integer) As Task(Of Boolean)
|
||||
Dim oFallback As Boolean = False
|
||||
|
||||
_Logger.Debug("ExecuteNonQueryFromServiceAsync called with SQL [{0}], DatabaseType [{1}], ConnectionId [{2}]", pSQLCommand, DatabaseType.ToString, pConnectionId)
|
||||
|
||||
If _Client Is Nothing OrElse _ClientConfig?.ForceDirectDatabaseAccess Then
|
||||
Return Await Task.Run(Function() ExecuteNonQueryFromDatabase(pSQLCommand, DatabaseType, pConnectionId))
|
||||
End If
|
||||
|
||||
Dim oResult As ExecuteNonQueryResponse = Nothing
|
||||
Try
|
||||
Select Case DatabaseType
|
||||
Case Constants.DatabaseType.ECM
|
||||
oResult = Await _Client.ExecuteNonQueryFromECMAsync(pSQLCommand)
|
||||
Case Constants.DatabaseType.IDB
|
||||
oResult = Await _Client.ExecuteNonQueryFromIDBAsync(pSQLCommand)
|
||||
Case Else
|
||||
oResult = Await _Client.ExecuteNonQueryFromConnectionAsync(pSQLCommand, pConnectionId)
|
||||
End Select
|
||||
|
||||
If oResult Is Nothing OrElse oResult.OK = False Then
|
||||
_Logger.Warn("⚠ ExecuteNonQueryFromServiceAsync failed. Falling back to direct database access.")
|
||||
oFallback = True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Warn("⚠ ExecuteNonQueryFromServiceAsync failed. Falling back to direct database access.")
|
||||
_Logger.Error(ex)
|
||||
oFallback = True
|
||||
End Try
|
||||
|
||||
If oFallback Then
|
||||
Return Await Task.Run(Function() ExecuteNonQueryFromDatabase(pSQLCommand, DatabaseType, pConnectionId))
|
||||
End If
|
||||
|
||||
Return oResult.Result
|
||||
End Function
|
||||
Private Function ExecuteNonQueryFromService(pSQLCommand As String, DatabaseType As Constants.DatabaseType, pConnectionId As Integer) As Boolean
|
||||
Try
|
||||
Dim oResult As ExecuteNonQueryResponse = Nothing
|
||||
|
||||
_Logger.Debug("ExecuteNonQueryFromService [{0}] with Connection Id [{1}] and Command [{2}]", DatabaseType.ToString, pConnectionId, pSQLCommand)
|
||||
Select Case DatabaseType
|
||||
Case Constants.DatabaseType.ECM
|
||||
oResult = _Client.ExecuteNonQueryFromECM(pSQLCommand)
|
||||
|
||||
Case Constants.DatabaseType.IDB
|
||||
oResult = _Client.ExecuteNonQueryFromIDB(pSQLCommand)
|
||||
|
||||
Case Else
|
||||
Return ExecuteNonQueryFromDatabase(pSQLCommand, DatabaseType, pConnectionId)
|
||||
|
||||
End Select
|
||||
|
||||
If oResult Is Nothing Then
|
||||
Throw New ApplicationException("Unexpected server error ocurred!")
|
||||
End If
|
||||
|
||||
If oResult.OK = False Then
|
||||
Throw New ApplicationException(oResult.ErrorMessage)
|
||||
If oResult Is Nothing OrElse oResult.OK = False Then
|
||||
_Logger.Warn("⚠ ExecuteNonQueryFromService: Service returned invalid response [{0}]. Falling back to direct database access.", If(oResult Is Nothing, "null", oResult.ErrorMessage))
|
||||
Return ExecuteNonQueryFromDatabase(pSQLCommand, DatabaseType, pConnectionId)
|
||||
End If
|
||||
|
||||
Return oResult.Result
|
||||
|
||||
Catch ex As InvalidOperationException
|
||||
_Logger.Warn("⚠ ExecuteNonQueryFromService skipped: [{0}] Falling back to direct database access.", ex.Message)
|
||||
Return ExecuteNonQueryFromDatabase(pSQLCommand, DatabaseType, pConnectionId)
|
||||
|
||||
Catch ex As Exception
|
||||
_Logger.Warn("ExecuteNonQueryFromService failed. Falling back to direct database access.")
|
||||
_Logger.Warn("⚠ ExecuteNonQueryFromService failed. Falling back to direct database access.")
|
||||
_Logger.Error(ex)
|
||||
Return ExecuteNonQueryFromDatabase(pSQLCommand, DatabaseType, pConnectionId)
|
||||
|
||||
@@ -456,6 +562,8 @@ Public Class DatabaseWithFallback
|
||||
|
||||
Private Function ExecuteNonQueryFromDatabase(pSQLCommand As String, DatabaseType As Constants.DatabaseType, pConnectionId As Integer) As Boolean
|
||||
Try
|
||||
_Logger.Debug("ExecuteNonQueryFromDatabase [{0}] with Connection Id [{1}] and Command [{2}]", DatabaseType.ToString, pConnectionId, pSQLCommand)
|
||||
|
||||
Select Case DatabaseType
|
||||
Case Constants.DatabaseType.IDB
|
||||
Return _DatabaseIDB.ExecuteNonQuery(pSQLCommand)
|
||||
|
||||
@@ -311,6 +311,9 @@
|
||||
<LastGenOutput>Reference.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="ErrorLog.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>powershell.exe -command "& { &'$(SolutionDir)copy-binary.ps1' '$(TargetPath)' '$(TargetFileName)' '$(ConfigurationName)' '$(ProjectName)' }"</PostBuildEvent>
|
||||
|
||||
333
EDMIAPI/ErrorLog.txt
Normal file
333
EDMIAPI/ErrorLog.txt
Normal file
@@ -0,0 +1,333 @@
|
||||
08:17:13.7755|DatabaseWithFallback|ERROR >> System.ServiceModel.EndpointNotFoundException: Es konnte keine Verbindung mit "net.tcp://10.1.2.152:9000/DigitalData/Services/Main" hergestellt werden. Der Verbindungsversuch hat für einen Zeitraum von 00:00:01.0060461 angedauert. TCP-Fehlercode 10061: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 10.1.2.152:9000.
|
||||
Es konnte keine Verbindung mit "net.tcp://10.1.2.152:9000/DigitalData/Services/Main" hergestellt werden. Der Verbindungsversuch hat für einen Zeitraum von 00:00:01.0060461 angedauert. TCP-Fehlercode 10061: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 10.1.2.152:9000. bei DigitalData.Modules.EDMI.API.Client.HandleCommunicationError(Exception ex, String callerName)
|
||||
bei DigitalData.Modules.EDMI.API.Client.VB$StateMachine_58_GetDatatableFromECMAsync.MoveNext()
|
||||
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
|
||||
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
|
||||
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
|
||||
bei System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
|
||||
bei DigitalData.Modules.EDMI.API.DatabaseWithFallback.VB$StateMachine_35_GetDatatableFromServiceAsync.MoveNext()
|
||||
Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 10.1.2.152:9000 bei System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
|
||||
bei System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
|
||||
bei System.ServiceModel.Channels.SocketConnectionInitiator.ConnectAsyncResult.OnConnect(IAsyncResult result)
|
||||
08:21:27.1457|Client|ERROR >> System.TimeoutException: Beim Anforderungskanal ist während des Wartens auf eine Antwort nach 00:00:06.6057132 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Beim Anforderungskanal ist während des Wartens auf eine Antwort nach 00:00:06.6057132 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Server stack trace:
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
|
||||
|
||||
Exception rethrown at [0]:
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
|
||||
bei DigitalData.Modules.EDMI.API.EDMIServiceReference.IEDMIService.ReturnDatatableFromCache(String Name, String FilterExpression, String SortByColumn)
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetDatatableByName(String DatatableName, String FilterExpression, String SortByColumn)
|
||||
Zeitüberschreitung bei der Socketübertragung nach 00:00:06.6050000. Das für die Bindung festgelegte Zeitlimit wurde überschritten. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.SingletonConnectionReader.Receive(TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.WaitForReply(TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
Fehler bei Lesevorgang, siehe interne Ausnahme. bei System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
|
||||
bei System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int32 count)
|
||||
bei System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
Zeitüberschreitung bei der Socketübertragung nach 00:00:06.6050000. Das für die Bindung festgelegte Zeitlimit wurde überschritten. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
|
||||
bei System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer, Int32 offset, Int32 count)
|
||||
bei System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
|
||||
bei System.Net.Security.NegotiateStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
|
||||
bei System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
|
||||
08:21:27.1457|DatabaseWithFallback|ERROR >> System.TimeoutException: Beim Anforderungskanal ist während des Wartens auf eine Antwort nach 00:00:06.6057132 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Beim Anforderungskanal ist während des Wartens auf eine Antwort nach 00:00:06.6057132 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Server stack trace:
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
|
||||
|
||||
Exception rethrown at [0]:
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
|
||||
bei DigitalData.Modules.EDMI.API.EDMIServiceReference.IEDMIService.ReturnDatatableFromCache(String Name, String FilterExpression, String SortByColumn)
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetDatatableByName(String DatatableName, String FilterExpression, String SortByColumn)
|
||||
bei DigitalData.Modules.EDMI.API.DatabaseWithFallback.GetDatatable(String pDataTableName, String pFallbackSQL, DatabaseType pFallbackType, String pFilterExpression, String pSortByColumn, Boolean pForceFallback, Int32 pConnectionId)
|
||||
Zeitüberschreitung bei der Socketübertragung nach 00:00:06.6050000. Das für die Bindung festgelegte Zeitlimit wurde überschritten. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.SingletonConnectionReader.Receive(TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.WaitForReply(TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
Fehler bei Lesevorgang, siehe interne Ausnahme. bei System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
|
||||
bei System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int32 count)
|
||||
bei System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
Zeitüberschreitung bei der Socketübertragung nach 00:00:06.6050000. Das für die Bindung festgelegte Zeitlimit wurde überschritten. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
|
||||
bei System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer, Int32 offset, Int32 count)
|
||||
bei System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
|
||||
bei System.Net.Security.NegotiateStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
|
||||
bei System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
|
||||
08:21:31.2008|Client|ERROR >> System.TimeoutException: Beim Anforderungskanal ist während eines Sendeversuch nach 00:00:30 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Beim Anforderungskanal ist während eines Sendeversuch nach 00:00:30 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Server stack trace:
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
|
||||
|
||||
Exception rethrown at [0]:
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
|
||||
bei DigitalData.Modules.EDMI.API.EDMIServiceReference.IEDMIService.ReturnScalarValue(GetScalarValueRequest pData)
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetScalarValueFromECM(String pSQL)
|
||||
Der Anforderungsvorgang wurde nicht innerhalb des zugewiesenen Zeitlimits von 00:00:30 abgeschlossen. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
Zeitüberschreitung bei der Socketübertragung nach 00:00:10.6514301. Das für die Bindung festgelegte Zeitlimit wurde überschritten. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
|
||||
bei System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.TimeoutConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer, Int32 offset, Int32 count)
|
||||
bei System.Net.StreamFramer.ReadMessage()
|
||||
bei System.Net.Security.NegoState.StartReceiveBlob(LazyAsyncResult lazyResult)
|
||||
bei System.Net.Security.NegoState.CheckCompletionBeforeNextReceive(LazyAsyncResult lazyResult)
|
||||
bei System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
|
||||
bei System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult)
|
||||
bei System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, ChannelBinding binding, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
|
||||
bei System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
|
||||
bei System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)
|
||||
bei System.ServiceModel.Channels.StreamSecurityUpgradeInitiatorBase.InitiateUpgrade(Stream stream)
|
||||
bei System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.SendPreamble(IConnection connection, TimeoutHelper& timeoutHelper, ClientFramingDecoder decoder, SecurityMessageProperty& remoteSecurity)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
|
||||
bei System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat bei System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
|
||||
bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
|
||||
08:21:31.2068|DatabaseWithFallback|ERROR >> System.TimeoutException: Beim Anforderungskanal ist während eines Sendeversuch nach 00:00:30 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Beim Anforderungskanal ist während eines Sendeversuch nach 00:00:30 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Server stack trace:
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
|
||||
|
||||
Exception rethrown at [0]:
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
|
||||
bei DigitalData.Modules.EDMI.API.EDMIServiceReference.IEDMIService.ReturnScalarValue(GetScalarValueRequest pData)
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetScalarValueFromECM(String pSQL)
|
||||
bei DigitalData.Modules.EDMI.API.DatabaseWithFallback.GetScalarValueFromService(String pSQLCommand, DatabaseType DatabaseType, Int32 pConnectionId)
|
||||
Der Anforderungsvorgang wurde nicht innerhalb des zugewiesenen Zeitlimits von 00:00:30 abgeschlossen. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
Zeitüberschreitung bei der Socketübertragung nach 00:00:10.6514301. Das für die Bindung festgelegte Zeitlimit wurde überschritten. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
|
||||
bei System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.TimeoutConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer, Int32 offset, Int32 count)
|
||||
bei System.Net.StreamFramer.ReadMessage()
|
||||
bei System.Net.Security.NegoState.StartReceiveBlob(LazyAsyncResult lazyResult)
|
||||
bei System.Net.Security.NegoState.CheckCompletionBeforeNextReceive(LazyAsyncResult lazyResult)
|
||||
bei System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
|
||||
bei System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult)
|
||||
bei System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, ChannelBinding binding, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
|
||||
bei System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
|
||||
bei System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)
|
||||
bei System.ServiceModel.Channels.StreamSecurityUpgradeInitiatorBase.InitiateUpgrade(Stream stream)
|
||||
bei System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.SendPreamble(IConnection connection, TimeoutHelper& timeoutHelper, ClientFramingDecoder decoder, SecurityMessageProperty& remoteSecurity)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
|
||||
bei System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat bei System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
|
||||
bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
|
||||
08:21:57.3155|Client|ERROR >> System.TimeoutException: Beim Anforderungskanal ist während eines Sendeversuch nach 00:00:30 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Beim Anforderungskanal ist während eines Sendeversuch nach 00:00:30 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Server stack trace:
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
|
||||
|
||||
Exception rethrown at [0]:
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
|
||||
bei DigitalData.Modules.EDMI.API.EDMIServiceReference.IEDMIService.ReturnScalarValue(GetScalarValueRequest pData)
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetScalarValueFromECM(String pSQL)
|
||||
Der Anforderungsvorgang wurde nicht innerhalb des zugewiesenen Zeitlimits von 00:00:30 abgeschlossen. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
Zeitüberschreitung bei der Socketübertragung nach 00:00:29.9989994. Das für die Bindung festgelegte Zeitlimit wurde überschritten. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
|
||||
bei System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.SendPreamble(IConnection connection, TimeoutHelper& timeoutHelper, ClientFramingDecoder decoder, SecurityMessageProperty& remoteSecurity)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
|
||||
bei System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat bei System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
|
||||
bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
|
||||
08:21:57.3165|DatabaseWithFallback|ERROR >> System.TimeoutException: Beim Anforderungskanal ist während eines Sendeversuch nach 00:00:30 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Beim Anforderungskanal ist während eines Sendeversuch nach 00:00:30 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Server stack trace:
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
|
||||
|
||||
Exception rethrown at [0]:
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
|
||||
bei DigitalData.Modules.EDMI.API.EDMIServiceReference.IEDMIService.ReturnScalarValue(GetScalarValueRequest pData)
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetScalarValueFromECM(String pSQL)
|
||||
bei DigitalData.Modules.EDMI.API.DatabaseWithFallback.GetScalarValueFromService(String pSQLCommand, DatabaseType DatabaseType, Int32 pConnectionId)
|
||||
Der Anforderungsvorgang wurde nicht innerhalb des zugewiesenen Zeitlimits von 00:00:30 abgeschlossen. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
Zeitüberschreitung bei der Socketübertragung nach 00:00:29.9989994. Das für die Bindung festgelegte Zeitlimit wurde überschritten. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
|
||||
bei System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.SendPreamble(IConnection connection, TimeoutHelper& timeoutHelper, ClientFramingDecoder decoder, SecurityMessageProperty& remoteSecurity)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
|
||||
bei System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat bei System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
|
||||
bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
|
||||
08:21:58.9285|DatabaseWithFallback|ERROR >> System.ServiceModel.EndpointNotFoundException: Es konnte keine Verbindung mit "net.tcp://10.1.2.152:9000/DigitalData/Services/Main" hergestellt werden. Der Verbindungsversuch hat für einen Zeitraum von 00:00:01.0050242 angedauert. TCP-Fehlercode 10061: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 10.1.2.152:9000.
|
||||
Es konnte keine Verbindung mit "net.tcp://10.1.2.152:9000/DigitalData/Services/Main" hergestellt werden. Der Verbindungsversuch hat für einen Zeitraum von 00:00:01.0050242 angedauert. TCP-Fehlercode 10061: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 10.1.2.152:9000.
|
||||
Server stack trace:
|
||||
bei System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.BufferedConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
|
||||
|
||||
Exception rethrown at [0]:
|
||||
bei DigitalData.Modules.EDMI.API.Client.HandleCommunicationError(Exception ex, String callerName)
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetDatatableByName(String DatatableName, String FilterExpression, String SortByColumn)
|
||||
bei DigitalData.Modules.EDMI.API.DatabaseWithFallback.GetDatatable(String pDataTableName, String pFallbackSQL, DatabaseType pFallbackType, String pFilterExpression, String pSortByColumn, Boolean pForceFallback, Int32 pConnectionId)
|
||||
Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 10.1.2.152:9000 bei System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
|
||||
bei System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
|
||||
bei System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
|
||||
08:21:58.9595|DatabaseWithFallback|ERROR >> System.InvalidOperationException: Client is offline.
|
||||
Client is offline. bei DigitalData.Modules.EDMI.API.Client.EnsureAvailable()
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetDatatableByName(String DatatableName, String FilterExpression, String SortByColumn)
|
||||
bei DigitalData.Modules.EDMI.API.DatabaseWithFallback.GetDatatable(String pDataTableName, String pFallbackSQL, DatabaseType pFallbackType, String pFilterExpression, String pSortByColumn, Boolean pForceFallback, Int32 pConnectionId)
|
||||
08:21:58.9595|DatabaseWithFallback|ERROR >> System.InvalidOperationException: Client is offline.
|
||||
Client is offline. bei DigitalData.Modules.EDMI.API.Client.EnsureAvailable()
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetDatatableByName(String DatatableName, String FilterExpression, String SortByColumn)
|
||||
bei DigitalData.Modules.EDMI.API.DatabaseWithFallback.GetDatatable(String pDataTableName, String pFallbackSQL, DatabaseType pFallbackType, String pFilterExpression, String pSortByColumn, Boolean pForceFallback, Int32 pConnectionId)
|
||||
08:21:59.1305|DatabaseWithFallback|ERROR >> System.InvalidOperationException: Client is offline.
|
||||
Client is offline. bei DigitalData.Modules.EDMI.API.Client.EnsureAvailable()
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetDatatableByName(String DatatableName, String FilterExpression, String SortByColumn)
|
||||
bei DigitalData.Modules.EDMI.API.DatabaseWithFallback.GetDatatable(String pDataTableName, String pFallbackSQL, DatabaseType pFallbackType, String pFilterExpression, String pSortByColumn, Boolean pForceFallback, Int32 pConnectionId)
|
||||
08:21:59.1915|DatabaseWithFallback|ERROR >> System.InvalidOperationException: Client is offline.
|
||||
Client is offline. bei DigitalData.Modules.EDMI.API.Client.EnsureAvailable()
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetDatatableByName(String DatatableName, String FilterExpression, String SortByColumn)
|
||||
bei DigitalData.Modules.EDMI.API.DatabaseWithFallback.GetDatatable(String pDataTableName, String pFallbackSQL, DatabaseType pFallbackType, String pFilterExpression, String pSortByColumn, Boolean pForceFallback, Int32 pConnectionId)
|
||||
08:21:59.2075|DatabaseWithFallback|ERROR >> System.InvalidOperationException: Client is offline.
|
||||
Client is offline. bei DigitalData.Modules.EDMI.API.Client.EnsureAvailable()
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetDatatableByName(String DatatableName, String FilterExpression, String SortByColumn)
|
||||
bei DigitalData.Modules.EDMI.API.DatabaseWithFallback.GetDatatable(String pDataTableName, String pFallbackSQL, DatabaseType pFallbackType, String pFilterExpression, String pSortByColumn, Boolean pForceFallback, Int32 pConnectionId)
|
||||
08:22:02.2282|Client|ERROR >> System.TimeoutException: Beim Anforderungskanal ist während eines Sendeversuch nach 00:00:30 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Beim Anforderungskanal ist während eines Sendeversuch nach 00:00:30 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Server stack trace:
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
|
||||
|
||||
Exception rethrown at [0]:
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
|
||||
bei DigitalData.Modules.EDMI.API.EDMIServiceReference.IEDMIService.ReturnDatatableFromCache(String Name, String FilterExpression, String SortByColumn)
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetDatatableByName(String DatatableName, String FilterExpression, String SortByColumn)
|
||||
Der Anforderungsvorgang wurde nicht innerhalb des zugewiesenen Zeitlimits von 00:00:30 abgeschlossen. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
Zeitüberschreitung bei der Socketübertragung nach 00:00:29.9990010. Das für die Bindung festgelegte Zeitlimit wurde überschritten. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
|
||||
bei System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.SendPreamble(IConnection connection, TimeoutHelper& timeoutHelper, ClientFramingDecoder decoder, SecurityMessageProperty& remoteSecurity)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
|
||||
bei System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat bei System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
|
||||
bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
|
||||
08:22:02.2282|DatabaseWithFallback|ERROR >> System.TimeoutException: Beim Anforderungskanal ist während eines Sendeversuch nach 00:00:30 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Beim Anforderungskanal ist während eines Sendeversuch nach 00:00:30 eine Zeitüberschreitung aufgetreten. Erhöhen Sie den an den Aufruf übergebenen Zeitlimitwert auf "Request", oder erhöhen Sie den SendTimeout-Wert für die Bindung. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts.
|
||||
Server stack trace:
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
|
||||
|
||||
Exception rethrown at [0]:
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
|
||||
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
|
||||
bei DigitalData.Modules.EDMI.API.EDMIServiceReference.IEDMIService.ReturnDatatableFromCache(String Name, String FilterExpression, String SortByColumn)
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetDatatableByName(String DatatableName, String FilterExpression, String SortByColumn)
|
||||
bei DigitalData.Modules.EDMI.API.DatabaseWithFallback.GetDatatable(String pDataTableName, String pFallbackSQL, DatabaseType pFallbackType, String pFilterExpression, String pSortByColumn, Boolean pForceFallback, Int32 pConnectionId)
|
||||
Der Anforderungsvorgang wurde nicht innerhalb des zugewiesenen Zeitlimits von 00:00:30 abgeschlossen. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
Zeitüberschreitung bei der Socketübertragung nach 00:00:29.9990010. Das für die Bindung festgelegte Zeitlimit wurde überschritten. Der für diesen Vorgang zugewiesene Zeitraum war möglicherweise ein Teil eines längeren Timeouts. bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
|
||||
bei System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.SendPreamble(IConnection connection, TimeoutHelper& timeoutHelper, ClientFramingDecoder decoder, SecurityMessageProperty& remoteSecurity)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
|
||||
bei System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat bei System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
|
||||
bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
|
||||
08:22:03.2452|DatabaseWithFallback|ERROR >> System.ServiceModel.EndpointNotFoundException: Es konnte keine Verbindung mit "net.tcp://10.1.2.152:9000/DigitalData/Services/Main" hergestellt werden. Der Verbindungsversuch hat für einen Zeitraum von 00:00:01.0020254 angedauert. TCP-Fehlercode 10061: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 10.1.2.152:9000.
|
||||
Es konnte keine Verbindung mit "net.tcp://10.1.2.152:9000/DigitalData/Services/Main" hergestellt werden. Der Verbindungsversuch hat für einen Zeitraum von 00:00:01.0020254 angedauert. TCP-Fehlercode 10061: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 10.1.2.152:9000.
|
||||
Server stack trace:
|
||||
bei System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.BufferedConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
|
||||
|
||||
Exception rethrown at [0]:
|
||||
bei DigitalData.Modules.EDMI.API.Client.HandleCommunicationError(Exception ex, String callerName)
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetDatatableByName(String DatatableName, String FilterExpression, String SortByColumn)
|
||||
bei DigitalData.Modules.EDMI.API.DatabaseWithFallback.GetDatatable(String pDataTableName, String pFallbackSQL, DatabaseType pFallbackType, String pFilterExpression, String pSortByColumn, Boolean pForceFallback, Int32 pConnectionId)
|
||||
Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 10.1.2.152:9000 bei System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
|
||||
bei System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
|
||||
bei System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
|
||||
08:22:03.2552|DatabaseWithFallback|ERROR >> System.InvalidOperationException: Client is offline.
|
||||
Client is offline. bei DigitalData.Modules.EDMI.API.Client.EnsureAvailable()
|
||||
bei DigitalData.Modules.EDMI.API.Client.GetDatatableByName(String DatatableName, String FilterExpression, String SortByColumn)
|
||||
bei DigitalData.Modules.EDMI.API.DatabaseWithFallback.GetDatatable(String pDataTableName, String pFallbackSQL, DatabaseType pFallbackType, String pFilterExpression, String pSortByColumn, Boolean pForceFallback, Int32 pConnectionId)
|
||||
08:22:13.3959|DatabaseWithFallback|ERROR >> System.ServiceModel.EndpointNotFoundException: Es konnte keine Verbindung mit "net.tcp://10.1.2.152:9000/DigitalData/Services/Main" hergestellt werden. Der Verbindungsversuch hat für einen Zeitraum von 00:00:01.0040254 angedauert. TCP-Fehlercode 10061: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 10.1.2.152:9000.
|
||||
Es konnte keine Verbindung mit "net.tcp://10.1.2.152:9000/DigitalData/Services/Main" hergestellt werden. Der Verbindungsversuch hat für einen Zeitraum von 00:00:01.0040254 angedauert. TCP-Fehlercode 10061: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 10.1.2.152:9000.
|
||||
Server stack trace:
|
||||
bei System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.BufferedConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
|
||||
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
|
||||
|
||||
Exception rethrown at [0]:
|
||||
bei DigitalData.Modules.EDMI.API.Client.HandleCommunicationError(Exception ex, String callerName)
|
||||
bei DigitalData.Modules.EDMI.API.Client.ExecuteNonQueryFromIDB(String pSQL)
|
||||
bei DigitalData.Modules.EDMI.API.DatabaseWithFallback.ExecuteNonQueryFromService(String pSQLCommand, DatabaseType DatabaseType, Int32 pConnectionId)
|
||||
Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 10.1.2.152:9000 bei System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
|
||||
bei System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
|
||||
bei System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
|
||||
@@ -25,7 +25,7 @@ Namespace Modules.IDB
|
||||
Return True
|
||||
End If
|
||||
|
||||
Logger.Warn("Error while setting Attribute Value: [{0}]", oResponse.ErrorMessage)
|
||||
Logger.Warn("⚠ Error while setting Attribute Value: [{0}]", oResponse.ErrorMessage)
|
||||
Return False
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
||||
<Assembly: AssemblyCompany("Digital Data")>
|
||||
<Assembly: AssemblyProduct("EDMIAPI")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2026")>
|
||||
<Assembly: AssemblyTrademark("2.0.0")>
|
||||
<Assembly: AssemblyTrademark("2.7.0")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.0.0.0")>
|
||||
<Assembly: AssemblyVersion("2.7.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.6.1.1")>
|
||||
|
||||
@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
||||
<Assembly: AssemblyCompany("Digital Data")>
|
||||
<Assembly: AssemblyProduct("Modules.Interfaces")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2026")>
|
||||
<Assembly: AssemblyTrademark("2.4.6.0")>
|
||||
<Assembly: AssemblyTrademark("2.5.0.0")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.6.0")>
|
||||
<Assembly: AssemblyFileVersion("2.4.6.0")>
|
||||
<Assembly: AssemblyVersion("2.5.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.5.0.0")>
|
||||
|
||||
@@ -209,10 +209,9 @@ Public Class ZUGFeRDInterface
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
End Try
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Public Function GetSerializedXMLContentFromFile(oFileInfo As FileInfo) As ZugferdResult
|
||||
|
||||
@@ -3,6 +3,7 @@ Imports System.Reflection
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports System.Xml
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports GdPicture.Internal.MSOfficeBinary.translator.Spreadsheet.XlsFileFormat.Records
|
||||
Imports GdPicture.Internal.MSOfficeBinary.translator.Tools
|
||||
|
||||
Public Class PropertyValues
|
||||
@@ -225,9 +226,15 @@ Public Class PropertyValues
|
||||
|
||||
' This should hopefully show config errors
|
||||
If TypeOf oPropertyValue Is List(Of Object) Then
|
||||
_logger.Warn("Item with specification [{0}] may be configured incorrectly", oTableColumn)
|
||||
_logger.Warn("Item [{0}] may be configured incorrectly", oTableColumn)
|
||||
oPropertyValue = Nothing
|
||||
End If
|
||||
|
||||
If IsComplexeObject(oPropertyValue) = True Then
|
||||
_logger.Debug("Item Value [{0}] is complexe. cant be used.", oTableColumn)
|
||||
oPropertyValue = Nothing
|
||||
End If
|
||||
|
||||
End Select
|
||||
End If
|
||||
Catch ex As Exception
|
||||
@@ -593,8 +600,21 @@ Public Class PropertyValues
|
||||
firstElement = oList.FirstOrDefault()
|
||||
If firstElement IsNot Nothing AndAlso IsArray(firstElement) Then
|
||||
|
||||
Dim oStr As String
|
||||
' Array behandeln -> erstes Element nehmen
|
||||
If TypeOf firstElement Is String() Then
|
||||
Dim arr As String() = CType(firstElement, String())
|
||||
oStr = If(arr.Length > 0, arr(0), String.Empty)
|
||||
Else
|
||||
oStr = firstElement.ToString()
|
||||
End If
|
||||
|
||||
If IsBase64String(oStr) Then
|
||||
' Attachments sind Byte-Arrays und müssen umgewandelt werden
|
||||
Return Convert.ToBase64String(firstElement)
|
||||
Else
|
||||
Return oStr
|
||||
End If
|
||||
|
||||
Else
|
||||
Return DoGetFinalPropValue(oList.First())
|
||||
@@ -636,4 +656,40 @@ Public Class PropertyValues
|
||||
Return Regex.IsMatch(Prop, _indexPattern)
|
||||
End Function
|
||||
|
||||
Private Function IsComplexeObject(obj As Object) As Boolean
|
||||
If obj Is Nothing Then Return False
|
||||
|
||||
Dim t As Type = obj.GetType()
|
||||
|
||||
' Einfache Typen ausschließen
|
||||
If t.IsPrimitive OrElse
|
||||
t.IsEnum OrElse
|
||||
t Is GetType(String) OrElse
|
||||
t Is GetType(Decimal) OrElse
|
||||
t Is GetType(DateTime) Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
' Wenn es öffentliche Properties hat, ist es "komplex"
|
||||
Return t.GetProperties().Length > 0 OrElse t.IsClass
|
||||
End Function
|
||||
|
||||
Function IsBase64String(str As String) As Boolean
|
||||
If String.IsNullOrEmpty(str) Then Return False
|
||||
|
||||
' Base64 hat bestimmte Zeichen und meist Länge Vielfaches von 4
|
||||
If str.Length Mod 4 <> 0 Then Return False
|
||||
|
||||
' Regex-Check für gültige Base64-Zeichen
|
||||
If Not System.Text.RegularExpressions.Regex.IsMatch(str, "^[A-Za-z0-9+/]*={0,2}$") Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Try
|
||||
Dim bytes As Byte() = Convert.FromBase64String(str)
|
||||
Return True
|
||||
Catch ex As FormatException
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
|
||||
@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
||||
<Assembly: AssemblyCompany("Digital Data")>
|
||||
<Assembly: AssemblyProduct("Modules.Jobs")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2026")>
|
||||
<Assembly: AssemblyTrademark("3.8.1.0")>
|
||||
<Assembly: AssemblyTrademark("3.9.0.0")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
@@ -30,5 +30,5 @@ Imports System.Runtime.InteropServices
|
||||
' Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
|
||||
<Assembly: AssemblyVersion("3.8.1.0")>
|
||||
<Assembly: AssemblyFileVersion("3.8.1.0")>
|
||||
<Assembly: AssemblyVersion("3.9.0.0")>
|
||||
<Assembly: AssemblyFileVersion("3.9.0.0")>
|
||||
|
||||
@@ -137,7 +137,11 @@ Namespace ZUGFeRD
|
||||
, '{pParameter2}'
|
||||
, 77"
|
||||
|
||||
If pTransaction IsNot Nothing Then
|
||||
_mssql.ExecuteNonQuery(oExecute, pTransaction)
|
||||
Else
|
||||
_mssql.ExecuteNonQuery(oExecute)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
|
||||
@@ -68,6 +68,7 @@ Public Class ImportZUGFeRDFiles
|
||||
Private ReadOnly _embeds As PDFEmbeds
|
||||
|
||||
Private SQL_xRechnung_ItemTemplate As String = ""
|
||||
Private SQL_ebInterface_CompleteXMLItems As String = ""
|
||||
|
||||
Private ReadOnly _gdpictureLicenseKey As String
|
||||
Private ReadOnly _xRechnungCreator As XRechnungViewDocument
|
||||
@@ -81,6 +82,8 @@ Public Class ImportZUGFeRDFiles
|
||||
|
||||
Public ZugferdFileCount As Integer = 0
|
||||
Public MD5Checksum As String = Nothing
|
||||
Public XMLSpecification As String = Nothing
|
||||
Public XMLSchema As String = Nothing
|
||||
|
||||
Public EmailAttachmentFiles As New List(Of FileInfo)
|
||||
Public EmbeddedAttachmentFiles As New List(Of PDFEmbeds.EmbeddedFile)
|
||||
@@ -114,6 +117,7 @@ Public Class ImportZUGFeRDFiles
|
||||
Public Sub Start(Arguments As Object) Implements IJob.Start
|
||||
Dim oArgs As WorkerArgs = Arguments
|
||||
Dim oAttachmentExtractor = New PDFEmbeds(_logConfig)
|
||||
Dim oSpecification As String = String.Empty
|
||||
|
||||
_EmailOutAccountId = oArgs.EmailOutProfileId
|
||||
|
||||
@@ -125,12 +129,16 @@ Public Class ImportZUGFeRDFiles
|
||||
})
|
||||
|
||||
_logger.Debug("Starting Job {0}", [GetType].Name)
|
||||
If oArgs.AllowXRechnung Then
|
||||
' TODO - Config-Schalter hat NIX mit XRechnung-Dateien u. Sichtbelegen zu tun, sondern nur mit Dateinamen zu tun.
|
||||
If oArgs.AllowXRechnung Or oArgs.AllowPeppolBISBill3x Or oArgs.AllowEBInterface Then
|
||||
Dim oSQL = "SELECT SQL_COMMAND FROM TBDD_SQL_COMMANDS WITH (NOLOCK) WHERE TITLE = 'VWDD_ZUGFERD_VIEW_RECEIPT_TEMPLATE_ITEMS'"
|
||||
SQL_xRechnung_ItemTemplate = _mssql.GetScalarValue(oSQL)
|
||||
End If
|
||||
|
||||
If oArgs.AllowEBInterface Then
|
||||
Dim oSQL = "SELECT SQL_COMMAND FROM TBDD_SQL_COMMANDS WITH (NOLOCK) WHERE TITLE = 'EBINTERFACE_COMPLETE_MISSING_XML_ITEMS'"
|
||||
SQL_ebInterface_CompleteXMLItems = _mssql.GetScalarValue(oSQL)
|
||||
End If
|
||||
|
||||
Try
|
||||
'For Each oPath As String In oArgs.WatchDirectory
|
||||
Dim oPath As String = oArgs.WatchDirectory
|
||||
@@ -209,6 +217,7 @@ Public Class ImportZUGFeRDFiles
|
||||
Try
|
||||
|
||||
For Each oFile In oEInvoiceFileGroup
|
||||
oSpecification = String.Empty
|
||||
oFileCounter += 1
|
||||
Dim oResult As ProcessFileResult
|
||||
|
||||
@@ -222,6 +231,7 @@ Public Class ImportZUGFeRDFiles
|
||||
_logger.Debug("eInvoice File found")
|
||||
oMD5CheckSum = oResult.MD5Checksum
|
||||
oZUGFeRDCount = oResult.ZugferdFileCount
|
||||
oSpecification = oResult.XMLSpecification
|
||||
oEmailAttachmentFiles.AddRange(oResult.EmailAttachmentFiles)
|
||||
oEmbeddedAttachmentFiles.AddRange(oResult.EmbeddedAttachmentFiles)
|
||||
Else ' No zugferd found!
|
||||
@@ -440,21 +450,34 @@ Public Class ImportZUGFeRDFiles
|
||||
If oMoveDirectory = DIRECTORY_DONT_MOVE Then
|
||||
_logger.Info("Application Error occurred. Files for message Id {0} will not be moved.", oMessageId)
|
||||
|
||||
ElseIf oArgs.AllowXRechnung And oIsSuccess And
|
||||
ElseIf (oArgs.AllowXRechnung Or oArgs.AllowPeppolBISBill3x Or oArgs.AllowEBInterface) And oIsSuccess And
|
||||
oEInvoiceFileGroup.Item(0).Extension.Equals(".xml", StringComparison.OrdinalIgnoreCase) = True Then
|
||||
_logger.Debug("Before Creating the PDF-File from XML data / Before Commit")
|
||||
|
||||
oxRechnungHandle = True
|
||||
|
||||
If oSQLTransaction IsNot Nothing Then
|
||||
' Commit Transaction - muss ausgeführt werden, sonst sind keine Daten in der DB vorhanden
|
||||
oSQLTransaction.Commit()
|
||||
_logger.Debug("XML commit triggered")
|
||||
End If
|
||||
|
||||
' Vor der Sichtbeleg-Erzeugung, müssen ggf Daten nachberechnet werden.
|
||||
' Hier wird die Prozedur für EBINTERFACE_61 aufgerufen, falls der Beleg dieses Schema verwendet
|
||||
If oArgs.AllowEBInterface AndAlso
|
||||
String.Equals(oSpecification, "EBINTERFACE_61", StringComparison.InvariantCultureIgnoreCase) AndAlso
|
||||
Not String.IsNullOrEmpty(SQL_ebInterface_CompleteXMLItems) Then
|
||||
_logger.Debug("Before Calling ebInterface Procedure")
|
||||
Dim oSQL_MsgIDReplace_1 As String = SQL_ebInterface_CompleteXMLItems.Replace("@MSG_ID", oFileGroup.Key)
|
||||
Dim oSqlResult = _mssql.ExecuteNonQuery(oSQL_MsgIDReplace_1)
|
||||
_logger.Debug("Result of ebInterface Procedure: [{0}]", oSqlResult)
|
||||
End If
|
||||
|
||||
' Hier das neue PDF erzeugen
|
||||
'but before we need to get all Data we need
|
||||
MyTemplateValues_xInvDT = Nothing
|
||||
Dim oSQL_MsgIDReplace = SQL_xRechnung_ItemTemplate
|
||||
oSQL_MsgIDReplace = oSQL_MsgIDReplace.Replace("@MSG_ID", oFileGroup.Key)
|
||||
If oSQLTransaction IsNot Nothing Then
|
||||
' Commit Transaction
|
||||
oSQLTransaction.Commit()
|
||||
_logger.Debug("XML commit triggered")
|
||||
End If
|
||||
MyTemplateValues_xInvDT = _mssql.GetDatatable(oSQL_MsgIDReplace)
|
||||
|
||||
If Not IsNothing(MyTemplateValues_xInvDT) Then
|
||||
@@ -598,6 +621,8 @@ Public Class ImportZUGFeRDFiles
|
||||
|
||||
If oDocument IsNot Nothing Then
|
||||
sqlResult = StoreXMLItemsInDatabase(pMessageId, oDocument, pFile, pConnections, pArgs, oResult)
|
||||
oResult.XMLSpecification = oDocument.Specification
|
||||
oResult.XMLSchema = oDocument.UsedXMLSchema
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
@@ -895,17 +895,55 @@ Public Class XRechnungViewDocument
|
||||
End Function
|
||||
|
||||
Private Sub RenderLabelValuePair(context As PdfRenderContext, label As String, value As String)
|
||||
context.PDF.DrawText(fontResName, MARGIN_LEFT, context.YPosition, label)
|
||||
Dim safeLabel As String = SanitizeForPdf(label)
|
||||
Dim safeValue As String = SanitizeForPdf(value)
|
||||
|
||||
context.PDF.DrawText(fontResName, MARGIN_LEFT, context.YPosition, safeLabel)
|
||||
|
||||
If context.CreateTextBox Then
|
||||
Dim textBoxYPos As Integer = context.YPosition - 3
|
||||
context.PDF.DrawTextBox(fontResName, COL_VALUE_X, textBoxYPos, 90, YCoo_TextBoxPlus5(textBoxYPos),
|
||||
TextAlignment.TextAlignmentFar, TextAlignment.TextAlignmentCenter,
|
||||
value)
|
||||
safeValue)
|
||||
Else
|
||||
context.PDF.DrawText(fontResName, COL_VALUE_X, context.YPosition, value)
|
||||
context.PDF.DrawText(fontResName, COL_VALUE_X, context.YPosition, safeValue)
|
||||
End If
|
||||
End Sub
|
||||
''' <summary>
|
||||
''' Bereinigt einen String vor der Übergabe an GdPicture DrawText.
|
||||
''' Entfernt Steuerzeichen, Surrogate und Format-/BiDi-Zeichen,
|
||||
''' die GdPictures UnicodeBidi-Algorithmus zum Absturz bringen.
|
||||
''' </summary>
|
||||
Private Function SanitizeForPdf(text As String) As String
|
||||
If String.IsNullOrEmpty(text) Then Return String.Empty
|
||||
|
||||
Dim sb As New System.Text.StringBuilder(text.Length)
|
||||
Dim removedChars As New System.Text.StringBuilder()
|
||||
|
||||
For Each c As Char In text
|
||||
Dim cat As Globalization.UnicodeCategory = Char.GetUnicodeCategory(c)
|
||||
|
||||
Dim isProblematic As Boolean =
|
||||
cat = Globalization.UnicodeCategory.Control OrElse
|
||||
cat = Globalization.UnicodeCategory.Surrogate OrElse
|
||||
cat = Globalization.UnicodeCategory.Format OrElse
|
||||
cat = Globalization.UnicodeCategory.OtherNotAssigned OrElse
|
||||
Char.IsHighSurrogate(c) OrElse
|
||||
Char.IsLowSurrogate(c)
|
||||
|
||||
If isProblematic Then
|
||||
removedChars.Append($"U+{AscW(c):X4}[{cat}] ")
|
||||
Else
|
||||
sb.Append(c)
|
||||
End If
|
||||
Next
|
||||
|
||||
If removedChars.Length > 0 Then
|
||||
_logger.Warn($"SanitizeForPdf: Removed [{removedChars.ToString().Trim()}] from text [{text.Substring(0, Math.Min(80, text.Length))}]")
|
||||
End If
|
||||
|
||||
Return sb.ToString()
|
||||
End Function
|
||||
|
||||
Private Sub RenderTextWithWrapping(context As PdfRenderContext, text As String)
|
||||
If text.Length > MAX_TEXT_LENGTH_FULL Then
|
||||
|
||||
@@ -510,7 +510,6 @@ Public Class LogConfig
|
||||
' Add debug rule, if configured
|
||||
If _EnableDebugLogging = True Then
|
||||
_config.AddRule(LogLevel.Debug, LogLevel.Error, TARGET_DEBUG)
|
||||
oLogger.Info("DEBUG Logging is now Enabled.")
|
||||
Else
|
||||
oLogger.Debug("DEBUG Logging is now Disabled.")
|
||||
End If
|
||||
|
||||
@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
||||
<Assembly: AssemblyCompany("Digital Data GmbH, Heuchelheim")>
|
||||
<Assembly: AssemblyProduct("Modules.Logging")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2025")>
|
||||
<Assembly: AssemblyTrademark("2.6.4.0")>
|
||||
<Assembly: AssemblyTrademark("2.7.0.0")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.6.5.0")>
|
||||
<Assembly: AssemblyFileVersion("2.6.5.0")>
|
||||
<Assembly: AssemblyVersion("2.7.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.7.0.0")>
|
||||
|
||||
@@ -247,7 +247,7 @@ Namespace Mail
|
||||
|
||||
Try
|
||||
If pSession.User <> String.Empty Then
|
||||
Logger.Info("Logging in with user [{0}] and Auth Type [{1}]", pSession.User, pSession.AuthType)
|
||||
Logger.Debug("Logging in with user [{0}] and Auth Type [{1}]", pSession.User, pSession.AuthType)
|
||||
|
||||
If pSession.AuthType = AUTH_OAUTH2 Then
|
||||
' Use OAuth2 token
|
||||
@@ -273,10 +273,10 @@ Namespace Mail
|
||||
Public Function DisconnectFromServer() As Boolean
|
||||
Try
|
||||
If Client IsNot Nothing Then
|
||||
Logger.Debug("Closing connection to Server [{0}].", Session.Server)
|
||||
Logger.Debug("Closing connection to Server [{0}]...", Session.Server)
|
||||
DoClose(Client)
|
||||
Session.Connected = False
|
||||
Logger.Info("Connection to Server [{0}] closed.", Session.Server)
|
||||
Logger.Debug("Connection to Server [{0}] closed.", Session.Server)
|
||||
Else
|
||||
Logger.Debug("No connection currently open. Exiting.")
|
||||
End If
|
||||
|
||||
@@ -40,6 +40,8 @@ Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Database.Test", "Database.T
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Filesystem", "Filesystem\Filesystem.vbproj", "{991D0231-4623-496D-8BD0-9CA906029CBC}"
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EDMIService", "..\DDMonorepo\Service.EDMIService\EDMIService.vbproj", "{A8C3F298-76AB-4359-AB3C-986E313B4336}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -114,6 +116,10 @@ Global
|
||||
{991D0231-4623-496D-8BD0-9CA906029CBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{991D0231-4623-496D-8BD0-9CA906029CBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{991D0231-4623-496D-8BD0-9CA906029CBC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A8C3F298-76AB-4359-AB3C-986E313B4336}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A8C3F298-76AB-4359-AB3C-986E313B4336}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A8C3F298-76AB-4359-AB3C-986E313B4336}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A8C3F298-76AB-4359-AB3C-986E313B4336}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user