diff --git a/SendNSWMessageService/NSWSendService.cs b/SendNSWMessageService/NSWSendService.cs index 5a446e45..11cfaeb3 100644 --- a/SendNSWMessageService/NSWSendService.cs +++ b/SendNSWMessageService/NSWSendService.cs @@ -267,13 +267,13 @@ namespace SendNSWMessageService } - // external processing for HIS-Nord - - bsmd.hisnord.transmitter.CallTransmitter(); - - bsmd.hisnord.Request.ReadResponseFiles(); - - bsmd.hisnord.Response.ReadAnswers(); + // external processing for HIS-Nord + bsmd.hisnord.transmitter.CallTransmitter(); + bsmd.hisnord.Request.ReadResponseFiles(); + bsmd.hisnord.Response.ReadAnswers(); + + // external processing for dbh + bsmd.dbh.MessageController.SendAndReceive(); List coresMarkedForStatusQuery = DBManager.Instance.GetMessageCoresWithNSWStatusFlag(); diff --git a/bsmd.dakosy/Properties/Settings.Designer.cs b/bsmd.dakosy/Properties/Settings.Designer.cs index 1cced959..5df74e9d 100644 --- a/bsmd.dakosy/Properties/Settings.Designer.cs +++ b/bsmd.dakosy/Properties/Settings.Designer.cs @@ -13,7 +13,7 @@ namespace bsmd.dakosy.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] - public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/bsmd.dakosy/Response.cs b/bsmd.dakosy/Response.cs index d096ecd1..440aa1cf 100644 --- a/bsmd.dakosy/Response.cs +++ b/bsmd.dakosy/Response.cs @@ -31,7 +31,7 @@ namespace bsmd.dakosy string localDir = Properties.Settings.Default.SFTPInDir; string remoteDir = Properties.Settings.Default.RemoteOutgoingDir; - SFtp.GetAll(remoteDir); + SFtp.GetAll(remoteDir, localDir); // lokale Dateien verarbeiten foreach (string inputFile in Directory.GetFiles(localDir)) diff --git a/bsmd.dakosy/bsmd.dakosy.csproj b/bsmd.dakosy/bsmd.dakosy.csproj index 96943368..0e60226a 100644 --- a/bsmd.dakosy/bsmd.dakosy.csproj +++ b/bsmd.dakosy/bsmd.dakosy.csproj @@ -77,7 +77,7 @@ - PublicSettingsSingleFileGenerator + SettingsSingleFileGenerator Settings.Designer.cs diff --git a/bsmd.dakosy/sftp.cs b/bsmd.dakosy/sftp.cs index eac0dc45..49ee4c1f 100644 --- a/bsmd.dakosy/sftp.cs +++ b/bsmd.dakosy/sftp.cs @@ -95,7 +95,7 @@ namespace bsmd.dakosy } - public static void GetAll(string remoteDir) + public static void GetAll(string remoteDir, string localDir) { Process winscp = new Process(); winscp.StartInfo.FileName = Properties.Settings.Default.WINSCPFullPath; @@ -110,7 +110,7 @@ namespace bsmd.dakosy winscp.StandardInput.WriteLine("option batch abort"); winscp.StandardInput.WriteLine("option confirm off"); winscp.StandardInput.WriteLine("open " + Properties.Settings.Default.SFTPSessionName); - winscp.StandardInput.WriteLine("lcd " + Properties.Settings.Default.SFTPInDir); + winscp.StandardInput.WriteLine("lcd " + localDir); // winscp.StandardInput.WriteLine("ls"); if (remoteDir != null) winscp.StandardInput.WriteLine("cd " + remoteDir); diff --git a/bsmd.dbh/MessageController.cs b/bsmd.dbh/MessageController.cs index 9b7d0135..b52093f4 100644 --- a/bsmd.dbh/MessageController.cs +++ b/bsmd.dbh/MessageController.cs @@ -69,26 +69,24 @@ namespace bsmd.dbh // receive files from remote host // SFTP verbindung öffnen und alle Dateien herunterladen - string localDir = bsmd.dakosy.Properties.Settings.Default.SFTPInDir; - string remoteDir = bsmd.dakosy.Properties.Settings.Default.RemoteOutgoingDir; + string localDir = Properties.Settings.Default.OutgoingFolder; - bsmd.dakosy.SFtp.GetAll(remoteDir); - - // lokale Dateien verarbeiten + bsmd.dakosy.SFtp.GetAll(Properties.Settings.Default.RemoteOutgoingFolder, Properties.Settings.Default.IncomingFolder); + foreach (string inputFile in Directory.GetFiles(localDir)) { + // lokale Dateien verarbeiten if (!ResponseUtil.Read(inputFile)) { _log.ErrorFormat("Error reading input file {0}", inputFile); } else { - File.Delete(inputFile); // alternativ: move to archive folder + File.Move(inputFile, Properties.Settings.Default.IncomingArchiveFolder); } // remote Dateien löschen - bsmd.dakosy.SFtp.RemoveProcessedFile(remoteDir, Path.GetFileName(inputFile)); - } - // process result files + bsmd.dakosy.SFtp.RemoveProcessedFile(Properties.Settings.Default.RemoteOutgoingFolder, Path.GetFileName(inputFile)); + } } } diff --git a/bsmd.dbh/Properties/Settings.Designer.cs b/bsmd.dbh/Properties/Settings.Designer.cs index d6126fbb..d5640b4e 100644 --- a/bsmd.dbh/Properties/Settings.Designer.cs +++ b/bsmd.dbh/Properties/Settings.Designer.cs @@ -23,7 +23,7 @@ namespace bsmd.dbh.Properties { } } - [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] [global::System.Configuration.DefaultSettingValueAttribute("https://edi-gate.dbh.de/test/bsmd-soap")] @@ -31,20 +31,77 @@ namespace bsmd.dbh.Properties { get { return ((string)(this["bsmd_dbh_DBHWebReference_Dbh_Osis_Answ_Ws"])); } - set { - this["bsmd_dbh_DBHWebReference_Dbh_Osis_Answ_Ws"] = value; - } } - [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("00003050")] public string Sender { get { return ((string)(this["Sender"])); } - set { - this["Sender"] = value; + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string OutgoingFolder { + get { + return ((string)(this["OutgoingFolder"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string OutgoingArchiveFolder { + get { + return ((string)(this["OutgoingArchiveFolder"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string IncomingFolder { + get { + return ((string)(this["IncomingFolder"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string IncomingArchiveFolder { + get { + return ((string)(this["IncomingArchiveFolder"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string RemoteIncomingFolder { + get { + return ((string)(this["RemoteIncomingFolder"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string RemoteOutgoingFolder { + get { + return ((string)(this["RemoteOutgoingFolder"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string SFTPSessionName { + get { + return ((string)(this["SFTPSessionName"])); } } } diff --git a/bsmd.dbh/Properties/Settings.settings b/bsmd.dbh/Properties/Settings.settings index 5b9997d1..11b06348 100644 --- a/bsmd.dbh/Properties/Settings.settings +++ b/bsmd.dbh/Properties/Settings.settings @@ -2,11 +2,32 @@ - + https://edi-gate.dbh.de/test/bsmd-soap - + 00003050 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bsmd.dbh/app.config b/bsmd.dbh/app.config index 9d617084..0b071a84 100644 --- a/bsmd.dbh/app.config +++ b/bsmd.dbh/app.config @@ -1,11 +1,11 @@ - -
+ +
- + https://edi-gate.dbh.de/test/bsmd-soap @@ -13,6 +13,27 @@ 00003050 + + + + + + + + + + + + + + + + + + + + + - - + +