Esempio n. 1
0
        static int Main(string[] args)
        {
            log.Info("Start.");
            var parser = new Parser(with => { with.HelpWriter = Console.Out; with.EnableDashDash = true; });
            try
            {
                objWS_S = new EArchiveClient("EArchiveDefaultTest");
                var isRunning = objWS_S.IsRunning();
                if (!isRunning)
                {
                    log.Error("Connection to webservice failed. Service is not running.");
                    return 2;
                }
            }
            catch (Exception ex)
            {
                log.Error(ex, "Connection to webservice failed. Is certificate configured properly?");
                return 1;
            }

            var result = parser.ParseArguments<SendLDocOptions, GetLDocOptions, SendLDocCSVOptions, GetSendLDocSchemaOptions>(args);
            var exitCode = result.MapResult(
                    (SendLDocOptions opts) => RunSendAndReturnExitCode(opts),
                    (GetLDocOptions opts) => RunGetAndReturnExitCode(opts),
                    (SendLDocCSVOptions opts) => RunSendFromCsvAndReturnExitCode(opts),
                    (GetSendLDocSchemaOptions opts) => RunGetSchemaAndReturnExitCode(opts),
                    errs => 1
                );
            objWS_S.Close();
            log.Info("All done.");
            return exitCode;
        }
Esempio n. 2
0
 public EArchiveController(EArchiveClient earchiveClient)
 {
     this.earchiveClient = earchiveClient;
 }