Exemple #1
0
        /// <summary>
        /// Solicit
        /// </summary>
        /// <returns></returns>
        public string Solicit(string flow, string request, ByIndexOrNameDictionary <string> arguments,
                              IList <string> notificationURIs)
        {
            Solicit            solicit    = NewSolicitObject(flow, request, arguments, notificationURIs);
            StatusResponseType statusResp = _requestor.Solicit(solicit);

            return(statusResp.transactionId.ToString());
        }
Exemple #2
0
        /// <summary>
        /// GetStatus
        /// </summary>
        /// <param name="transactionId"></param>
        /// <returns></returns>
        public CommonTransactionStatusCode GetStatus(string transactionId, out string statusDetail)
        {
            GetStatus          status     = NewStatusObject(transactionId);
            StatusResponseType statusResp = _requestor.GetStatus(status);

            statusDetail = statusResp.statusDetail;
            return(EnumUtils.ParseEnum <CommonTransactionStatusCode>(statusResp.status.ToString()));
        }
Exemple #3
0
        /// <summary>
        /// NotifyDocument
        /// </summary>
        /// <returns></returns>
        public string NotifyDocument20(string endpoint, string flow, CommonTransactionStatusCode status,
                                       string description, params string[] documentIds)
        {
            Notify notify = NewDocumentNotifyObject(endpoint, flow, status, description,
                                                    documentIds);
            StatusResponseType statusResp = _requestor.Notify(notify);

            return(statusResp.transactionId);
        }
Exemple #4
0
        /// <summary>
        /// NotifyStatus
        /// </summary>
        /// <param name="endpoint"></param>
        /// <param name="flow"></param>
        /// <param name="transactionId"></param>
        /// <param name="status"></param>
        /// <param name="description"></param>
        /// <returns></returns>
        public CommonTransactionStatusCode NotifyStatus20(string endpoint, string flow, string transactionId,
                                                          CommonTransactionStatusCode status, string description)
        {
            Notify notify = NewStatusNotifyObject(endpoint, flow, transactionId, status,
                                                  description);
            StatusResponseType statusResp = _requestor.Notify(notify);

            return(CommonTransactionStatusCodeProvider.Convert(statusResp.status.ToString()));
        }
Exemple #5
0
        /// <summary>
        /// Submit
        /// </summary>
        /// <param name="flow"></param>
        /// <param name="operation"></param>
        /// <param name="transactionId"></param>
        /// <param name="notificationURIs"></param>
        /// <param name="documentPaths"></param>
        /// <returns></returns>
        private string Submit(string flow, string operation, string transactionId,
                              IList <string> notificationURIs, IList <string> documentPaths,
                              IList <EndpointDocument> documents)
        {
            Submit submit = NewSubmitObject(flow, operation, transactionId, notificationURIs,
                                            documentPaths, documents);
            StatusResponseType response = _requestor.Submit(submit);

            return(response.transactionId);
        }
Exemple #6
0
        /// <summary>
        /// NotifyEvent
        /// </summary>
        /// <returns></returns>
        public CommonTransactionStatusCode NotifyEvent20(string nodeEndpoint, string flow, string messageName,
                                                         CommonTransactionStatusCode status, string description,
                                                         string eventName)
        {
            Notify notify =
                NewEventNotifyObject(nodeEndpoint, flow, messageName, status, description, eventName);
            StatusResponseType statusResp = _requestor.Notify(notify);

            return(CommonTransactionStatusCodeProvider.Convert(statusResp.status.ToString()));
        }
Exemple #7
0
        protected void btnGetStatus_Click(object sender, EventArgs e)
        {
            string OrgID = Session["OrgID"].ToString();

            //get credentials
            CDXCredentials cred = WQXSubmit.GetCDXSubmitCredentials2(OrgID);

            //auth
            string token = WQXSubmit.AuthHelper(cred.userID, cred.credential, "Password", "default", cred.NodeURL);

            StatusResponseType gsResp = WQXSubmit.GetStatusHelper(cred.NodeURL, token, txtTransID.Text);
            string             status = gsResp.status.ToString();
        }
        public static void ATTAINS_byReport(int ReportIDX)
        {
            //get OrgID for the report
            T_ATTAINS_REPORT r = db_Attains.GetT_ATTAINS_REPORT_byID(ReportIDX);

            if (r != null)
            {
                //get CDX username, password, and CDX destination URL
                CDXCredentials cred = WQXSubmit.GetCDXSubmitCredentials2(r.ORG_ID);

                //*******AUTHENTICATE*********************************************************************************************************
                string token = WQXSubmit.AuthHelper(cred.userID, cred.credential, "Password", "default", cred.NodeURL);

                //*******SUBMIT***************************************************************************************************************
                string requestXml = db_Attains.SP_GenATTAINSXML(ReportIDX);   //get XML from DB stored procedure
                byte[] bytes      = Utils.StrToByteArray(requestXml);
                if (bytes == null)
                {
                    return;
                }

                StatusResponseType subStatus = WQXSubmit.SubmitHelper(cred.NodeURL, token, "ATTAINS", "default", bytes, "submit.xml", DocumentFormatType.XML, "1");
                if (subStatus != null)
                {
                    //*******GET STATUS********************************************************************************************************
                    string status = "";
                    int    i      = 0;
                    do
                    {
                        i += 1;
                        Thread.Sleep(10000);
                        StatusResponseType gsResp = WQXSubmit.GetStatusHelper(cred.NodeURL, token, subStatus.transactionId);
                        if (gsResp != null)
                        {
                            status = gsResp.status.ToString();
                            //exit if waiting too long
                            if (i > 30)
                            {
                                //UpdateRecordStatus(typeText, RecordIDX, "N");
                                //db_Ref.InsertUpdateWQX_TRANSACTION_LOG(null, typeText, RecordIDX, "I", null, "Timed out while getting status from EPA", subStatus.transactionId, "Failed", orgID);
                                return;
                            }
                        }
                    } while (status != "Failed" && status != "Completed");
                }
            }
        }