Ejemplo n.º 1
0
            public static void AddQueryInfoParameter(QueryInfoType queryInfo, String name, String value)
            {
                if (queryInfo == null)
                {
                    queryInfo = CreateQueryInfoType();
                }
                if (queryInfo.criteria.parameter == null)
                {
                    QueryInfoTypeCriteriaParameter p = new QueryInfoTypeCriteriaParameter();
                    p.name  = name;
                    p.value = value;
                    queryInfo.criteria.parameter    = new QueryInfoTypeCriteriaParameter[1];
                    queryInfo.criteria.parameter[0] = p;
                }
                else
                {
                    QueryInfoTypeCriteriaParameter[]      parameters = queryInfo.criteria.parameter;
                    List <QueryInfoTypeCriteriaParameter> list       = new List <QueryInfoTypeCriteriaParameter>(parameters);

                    QueryInfoTypeCriteriaParameter p = new QueryInfoTypeCriteriaParameter();
                    p.name  = name;
                    p.value = value;
                    list.Add(p);

                    queryInfo.criteria.parameter = list.ToArray();
                }
            }
Ejemplo n.º 2
0
            public static QueryInfoType CreateQueryInfoType(String method)
            {
                QueryInfoType queryInfo = CreateQueryInfoType();

                queryInfo.criteria.MethodCalled = method;
                return(queryInfo);
            }
Ejemplo n.º 3
0
            public static QueryInfoType CreateQueryInfoType()
            {
                QueryInfoType queryInfo = new QueryInfoType();

                queryInfo.creationTime          = DateTime.Now;
                queryInfo.creationTimeSpecified = true;
                queryInfo.criteria = new QueryInfoTypeCriteria();

                return(queryInfo);
            }
Ejemplo n.º 4
0
            void IXmlSerializable.ReadXml(XmlReader r)
            {
                XmlQualifiedName qname;

                //string type = r.GetAttribute("type", XmlSchema.InstanceNamespace);

                //if (type == null)
                //    qname = null;

                //qname = ToQname(r, type);

                //if (qname != null)
                //{
                //    if (qname.Namespace != OrdersNamespace || qname.Name != "Order")
                //        throw new InvalidOperationException("Unexpected xsi:type='" + qname + "'");
                //}
                //type = r.GetAttribute("nil", XmlSchema.InstanceNamespace);

                //if (IsNull(r))
                //{
                //    r.Skip();
                //    return o;
                //}

                //if (r.IsEmptyElement)
                //    return o;

                //if (o == null)
                //    o = new Order();

                r.ReadStartElement("timeSeriesResponse", WaterOneFlowImpl.v1_0.Constants.XML_SCHEMA_NAMSPACE);

                if (r.LocalName.Equals("queryInfo"))
                {
                    XmlRootAttribute qi = new XmlRootAttribute("queryInfo");
                    qi.Namespace = ServiceDescriptions.XML_SCHEMA_NAMSPACE;
                    XmlSerializer queryInfo =
                        WOFXmlSerializerFactory.GetSerializer(typeof(NWISWS.QueryInfoType), qi);

                    wofQueryInfo = (QueryInfoType)queryInfo.Deserialize(r);
                }
                if (r.LocalName.Equals("timeSeries"))
                {
                    XmlRootAttribute qi = new XmlRootAttribute("timeSeries");
                    qi.Namespace = ServiceDescriptions.XML_SCHEMA_NAMSPACE;
                    XmlSerializer queryInfo =
                        WOFXmlSerializerFactory.GetSerializer(typeof(NWISWS.TimeSeriesType), qi);

                    wofTimeSeries = r.ReadOuterXml();
                }
                r.ReadEndElement();
            }
Ejemplo n.º 5
0
        public static QueryInfoType CreateQueryInfo(string webMethodName)
        {
            QueryInfoType queryInfo = new QueryInfoType();
            queryInfo.creationTime = DateTime.Now;
            queryInfo.creationTimeSpecified = true;
            queryInfo.criteria = new QueryInfoTypeCriteria();
            queryInfo.criteria.locationParam = String.Empty;
            queryInfo.criteria.MethodCalled = webMethodName;
            queryInfo.criteria.variableParam = String.Empty;
            queryInfo.queryURL = @"http://example.com";

            return queryInfo;
        }
Ejemplo n.º 6
0
            public static QueryInfoType CreateQueryInfoType(string method, string[] sites, string[] locations, string[] variables, string beginDateTime, string endDateTime)
            {
                QueryInfoType queryInfo = CreateQueryInfoType();

                queryInfo.criteria.MethodCalled = method;

                if (sites != null)
                {
                    foreach (string site in sites)
                    {
                        AddQueryInfoParameter(queryInfo, "site", site);
                    }
                }
                if (locations != null)
                {
                    foreach (string location in locations)
                    {
                        AddQueryInfoParameter(queryInfo, "location", location);
                    }
                }
                if (variables != null)
                {
                    foreach (string variable in variables)
                    {
                        AddQueryInfoParameter(queryInfo, "variable", variable);
                    }
                }

                if (!string.IsNullOrEmpty(beginDateTime))
                {
                    AddQueryInfoParameter(queryInfo, "startDate", beginDateTime);
                }
                if (!string.IsNullOrEmpty(endDateTime))
                {
                    AddQueryInfoParameter(queryInfo, "endDate", endDateTime);
                }
                return(queryInfo);
            }
            public static QueryInfoType CreateQueryInfoType()
            {
                QueryInfoType queryInfo = new QueryInfoType();
                queryInfo.creationTime = DateTime.Now;
                queryInfo.creationTimeSpecified = true;
                queryInfo.criteria = new QueryInfoTypeCriteria();

                return queryInfo;
            }
            public static void AddQueryInfoParameter(QueryInfoType queryInfo, String name, String value)
            {
                if (queryInfo == null) queryInfo = CreateQueryInfoType();
                if (queryInfo.criteria.parameter == null )
                {
                    QueryInfoTypeCriteriaParameter p = new QueryInfoTypeCriteriaParameter();
                    p.name = name;
                    p.value = value;
                    queryInfo.criteria.parameter = new QueryInfoTypeCriteriaParameter[1];
                    queryInfo.criteria.parameter[0] = p;
                } else
                {
                    QueryInfoTypeCriteriaParameter[] parameters = queryInfo.criteria.parameter;
                    List<QueryInfoTypeCriteriaParameter> list = new List<QueryInfoTypeCriteriaParameter>(parameters);

                    QueryInfoTypeCriteriaParameter p = new QueryInfoTypeCriteriaParameter();
                    p.name = name;
                    p.value = value;
                    list.Add(p);

                    queryInfo.criteria.parameter = list.ToArray();
                }
            }