예제 #1
0
        protected virtual void ParseWebServiceArguments()
        {
            var    args    = GetWebServiceArguments();
            double version = double.Parse(args.AQSXMLSchemaVersion);

            if (version >= 3.0)
            {
                _webServiceQueryArguments3 = new AQS3WebServiceArgument();
                _webServiceQueryArguments3.AQSXMLSchemaVersion = args.AQSXMLSchemaVersion;
                _webServiceQueryArguments3.CompressPayload     = args.CompressPayload;
                _webServiceQueryArguments3.EndTime             = args.EndTime;
                _webServiceQueryArguments3.SendMonitorAssuranceTransactions = args.SendMonitorAssuranceTransactions;
                _webServiceQueryArguments3.SendOnlyQAData     = args.SendOnlyQAData;
                _webServiceQueryArguments3.SendRBTransactions = args.SendRBTransactions;
                _webServiceQueryArguments3.SendRDTransactions = args.SendRDTransactions;
                _webServiceQueryArguments3.StartTime          = args.StartTime;
                _webServiceQueryArguments3.Tags = args.Tags;
                _webServiceQueryArguments       = null;
            }
            else
            {
                _webServiceQueryArguments  = args;
                _webServiceQueryArguments3 = null;
            }
        }
예제 #2
0
        public AQSXmlResultData GetAQSXmlData([System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] AQSWebServiceArgument args)
        {
            object[] results = this.Invoke("GetAQSXmlData", new object[] {
                args
            });

            return((AQSXmlResultData)(results[0]));
        }
예제 #3
0
 /// <remarks/>
 public void GetAQSXmlDataAsync(AQSWebServiceArgument args, object userState)
 {
     if ((this.GetAQSXmlDataOperationCompleted == null))
     {
         this.GetAQSXmlDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAQSXmlDataOperationCompleted);
     }
     this.InvokeAsync("GetAQSXmlData", new object[] {
         args
     }, this.GetAQSXmlDataOperationCompleted, userState);
 }
예제 #4
0
 /// <remarks/>
 public void GetAQSXmlDataAsync(AQSWebServiceArgument args)
 {
     this.GetAQSXmlDataAsync(args, null);
 }
예제 #5
0
        protected virtual AQSWebServiceArgument GetWebServiceArguments()
        {
            AQSWebServiceArgument arguments = new AQSWebServiceArgument();

            int paramIndex = 0;

            List <PipedParameter <string> > agencyCodes       = TryGetPipedParameters <string>(_dataRequest, PARAM_AGENCY_CODE, paramIndex++);
            List <PipedParameter <string> > siteCodes         = TryGetPipedParameters <string>(_dataRequest, PARAM_SITE_CODE, paramIndex++);
            List <PipedParameter <string> > parameterCodes    = TryGetPipedParameters <string>(_dataRequest, PARAM_PARAMETER_CODE, paramIndex++);
            List <PipedParameter <string> > durationCodes     = TryGetPipedParameters <string>(_dataRequest, PARAM_DURATION_CODE, paramIndex++);
            List <PipedParameter <string> > occurrenceCodes   = TryGetPipedParameters <string>(_dataRequest, PARAM_OCCURRENCE_CODE, paramIndex++);
            List <PipedParameter <string> > stateCodes        = TryGetPipedParameters <string>(_dataRequest, PARAM_STATE_CODE, paramIndex++);
            List <PipedParameter <string> > countyTribalCodes = TryGetPipedParameters <string>(_dataRequest, PARAM_COUNTY_TRIBAL_CODE, paramIndex++);

            int maxTagCount = CollectionUtils.Count(agencyCodes);

            maxTagCount = Math.Max(maxTagCount, CollectionUtils.Count(siteCodes));
            maxTagCount = Math.Max(maxTagCount, CollectionUtils.Count(parameterCodes));
            maxTagCount = Math.Max(maxTagCount, CollectionUtils.Count(durationCodes));
            maxTagCount = Math.Max(maxTagCount, CollectionUtils.Count(occurrenceCodes));
            maxTagCount = Math.Max(maxTagCount, CollectionUtils.Count(stateCodes));
            maxTagCount = Math.Max(maxTagCount, CollectionUtils.Count(countyTribalCodes));
            if (maxTagCount > 0)
            {
                List <AQSParameterTag> tags = new List <AQSParameterTag>(maxTagCount);
                for (int i = 0; i < maxTagCount; ++i)
                {
                    bool            setAny = false;
                    AQSParameterTag tag    = new AQSParameterTag();
                    if (CollectionUtils.Count(agencyCodes) > i)
                    {
                        setAny         = true;
                        tag.AgencyCode = agencyCodes[i].Value;
                    }
                    if (CollectionUtils.Count(siteCodes) > i)
                    {
                        setAny       = true;
                        tag.SiteCode = siteCodes[i].Value;
                    }
                    if (CollectionUtils.Count(parameterCodes) > i)
                    {
                        setAny            = true;
                        tag.ParameterCode = parameterCodes[i].Value;
                    }
                    if (CollectionUtils.Count(durationCodes) > i)
                    {
                        setAny           = true;
                        tag.DurationCode = durationCodes[i].Value;
                    }
                    if (CollectionUtils.Count(occurrenceCodes) > i)
                    {
                        string strValue = occurrenceCodes[i].Value;
                        if (!string.IsNullOrEmpty(strValue))
                        {
                            int occurrenceCode;
                            if (!int.TryParse(strValue, out occurrenceCode))
                            {
                                throw new ArgException("An occurrence code was specified that cannot be parsed as an integer: {0}", strValue);
                            }
                            setAny = true;
                            tag.ParameterOccurrenceCode          = occurrenceCode;
                            tag.ParameterOccurrenceCodeSpecified = true;
                        }
                    }
                    if (CollectionUtils.Count(stateCodes) > i)
                    {
                        setAny        = true;
                        tag.StateCode = stateCodes[i].Value;
                    }
                    if (CollectionUtils.Count(countyTribalCodes) > i)
                    {
                        setAny = true;
                        tag.CountyTribalCode = countyTribalCodes[i].Value;
                    }
                    if (setAny)
                    {
                        tags.Add(tag);
                    }
                }
                arguments.Tags = tags.ToArray();
            }

            if (!TryGetNowDateParameter(_dataRequest, PARAM_START_TIME, paramIndex++, ref arguments.StartTime))
            {
                arguments.StartTime = DateTime.Now.AddYears(-1);
            }
            if (!TryGetNowDateParameter(_dataRequest, PARAM_END_TIME, paramIndex++, ref arguments.EndTime))
            {
                arguments.EndTime = DateTime.Now;
            }

            if (!TryGetParameter(_dataRequest, PARAM_SCHEMA_VERSION, paramIndex++, ref arguments.AQSXMLSchemaVersion))
            {
                arguments.AQSXMLSchemaVersion = "2.2";
            }

            TryGetParameter(_dataRequest, PARAM_SEND_RD_TRANSACTIONS, paramIndex++, ref arguments.SendRDTransactions);
            TryGetParameter(_dataRequest, PARAM_SEND_RB_TRANSACTIONS, paramIndex++, ref arguments.SendRBTransactions);
            TryGetParameter(_dataRequest, PARAM_SEND_RA_TRANSACTIONS, paramIndex++, ref arguments.SendRATransactions);
            TryGetParameter(_dataRequest, PARAM_SEND_RP_TRANSACTIONS, paramIndex++, ref arguments.SendRPTransactions);
            TryGetParameter(_dataRequest, PARAM_SEND_ONLY_QA_DATA, paramIndex++, ref arguments.SendOnlyQAData);
            TryGetParameter(_dataRequest, PARAM_SEND_MA_TRANSACTIONS, paramIndex++, ref arguments.SendMonitorAssuranceTransactions);
            arguments.CompressPayload = true;

            //byte[] argumentBytes = _serializationHelper.SerializeWithLineBreaks(arguments);
            //File.WriteAllBytes(@"D:\Download\Query.xml", argumentBytes);
            //Document doc = new Document("RequestArguments.xml", CommonContentType.XML, argumentBytes);
            //doc.DontAutoCompress = true;
            //_documentManager.AddDocument(_dataRequest.TransactionId, CommonTransactionStatusCode.Completed,
            //                             null, doc);

            string requestDataString = _dataRequest.Parameters.GetKeyValuesString();

            AppendAuditLogEvent("GetAQSXmlData request arguments, {0}", requestDataString);

            return(arguments);
        }