public void FTPExchange()
        {
            //Mock exchange
            ExchangeRequest request = new ExchangeRequest()
            {
                ExchangeID   = 9999,
                RequestID    = Guid.NewGuid().ToString(),
                ExchangeName = "FTP Download",

                //InputUri = "https://showcase.equivant.com/eps/exchangePointservice.svc/...",
                ProcessingMode = ProcessingMode.NonRealTime // required for test
            };

            //Load workflow to be tested
            var wfMgr = new WorkflowManager();

            wfMgr.LoadFromPath(_workflowRootDir + @"\DES\FTPExampleWorkflow.xaml");

            var ep = new Exchange.ServerLib.ExchangePoint(true, wfMgr);

            var response = ep.PerformAsyncDataExchange(request);

            Assert.IsNotNull(response);

            Console.WriteLine($"RequestID: {response.RequestID}");

            Assert.IsNotNull(response.Result);

            Console.WriteLine($"Response: { response.Result.SelectSingleNode("ftpdata")?.InnerText}");
        }
Beispiel #2
0
        /// <summary>
        /// Executes a XAML workflow in the DES context. This requires a DES <connectionStrings> configured in the app.config.
        /// </summary>
        /// <param name="workflowPath"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public static ExchangeResponse ExecWorkflowInDES(string workflowPath, Dictionary <string, string> parameters)
        {
            if (!IsWFPathValid(workflowPath))
            {
                return(null);
            }

            //Create an ExchangeRequest that models the real DES web request
            ExchangeRequest request = new ExchangeRequest()
            {
                ExchangeID     = 9999,
                RequestID      = Guid.NewGuid().ToString(),
                ExchangeName   = "Hello DES",
                ProcessingMode = ProcessingMode.NonRealTime, // required for test
                                                             //TODO: 2. Add any parameter required by the workflow. These come from the url query string, segment or exchange setting.
                ExchangeParameters = parameters
            };

            var wfMgr = new WorkflowManager();

            wfMgr.LoadFromPath(workflowPath);

            var ep = new Exchange.ServerLib.ExchangePoint(true, wfMgr);

            Console.Write("\nExecuting workflow {0} in DES...", Path.GetFileName(workflowPath));

            var response = ep.PerformAsyncDataExchange(request);

            Console.WriteLine("Done!\n");

            Console.WriteLine("DES Response:");
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("\n{0}\n", response.ToString());
            Console.ForegroundColor = _ogColor;

            return(response);
        }