Beispiel #1
0
        private StartDownloadJobResponse StartDownloadJob(BulkDataReportType reportType)
        {
            _CurrentOperationName = "startDownloadJob";

            var jobRequest = new StartDownloadJobRequest();

            jobRequest.downloadJobType = reportType.ToString();
            jobRequest.UUID            = Guid.NewGuid().ToString();

            return(base.startDownloadJob(jobRequest));
        }
Beispiel #2
0
        private string startDownloadJob(frmLMSMain sender, HttpRequestMessageProperty httpRequest, string ReportType)
        {
            string txt = "";

                sender.DownloadStatus = "Calling startDownloadJob\n";
                try
                {
                    BulkDataExchangeServicePortClient client = new BulkDataExchangeServicePortClient(BDXconfigName);
                    using (OperationContextScope scope = new OperationContextScope(client.InnerChannel))
                    {

                        OperationContext.Current.OutgoingMessageProperties.Add(HttpRequestMessageProperty.Name, httpRequest);

                        StartDownloadJobRequest req = new StartDownloadJobRequest();
                        req.downloadJobType = ReportType;

                        // Generate a UUID. UUID must be unique.  Once used, you can't use it again
                        req.UUID = System.Guid.NewGuid().ToString();

                        StartDownloadJobResponse resp = client.startDownloadJob(req);

                        // update the status of the request (success / fail) and any messages returned
                        // add any error messages received
                        if (resp.errorMessage != null)
                        {
                                ErrorAdmin.updateResponseStatus(resp, sender, false);
                        }

                        if (resp.jobId != null)
                        {
                            txt += resp.timestamp + " :: " + ReportType + " with jobID: " + resp.jobId + " has been created.\n";
                            Console.WriteLine(txt);
                            sender.DownloadStatus += txt;
                            return resp.jobId;

                        }
                        else
                            return "";
                    }
                }
                catch(Exception ex)
                {
                    sender.DownloadStatus += ex + "\n";
                    return "";
                }
        }