Ejemplo n.º 1
0
        /// <summary>
        /// Returns a string array of searchable concept names
        /// </summary>
        /// <returns>the xml file with all concept keywords</returns>
        public void GetSearchableConcepts(string xmlFileName)
        {
            string soapAction = cuahsiSoapAction + "GetSearchableConcepts";

            StringBuilder soapEnvelope = new StringBuilder();

            soapEnvelope.Append(soapEnvelopeHeader);
            soapEnvelope.Append(@"<GetSearchableConcepts ");
            soapEnvelope.Append(cuahsiXmlns);
            soapEnvelope.Append(@"/>");
            soapEnvelope.Append(soapEnvelopeClosing);

            watch1.Start();
            SoapHelper.HttpSOAPToFile(_asmxURL, soapEnvelope.ToString(), soapAction, xmlFileName);
            watch1.Stop();
            Debug.WriteLine("GetSearchableConcepts: " + watch1.ElapsedMilliseconds);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Download the keyword xml file from server to
        /// and save it on local disk
        /// </summary>
        /// <param name="xmlFileName"></param>
        /// <returns></returns>
        public void DownloadOntologyTree(string xmlFileName)
        {
            string soapAction = @"http://hiscentral.cuahsi.org/20100205/getOntologyTree";

            StringBuilder soapEnvelope = new StringBuilder();

            soapEnvelope.Append(soapEnvelopeHeader);
            soapEnvelope.Append(@"<getOntologyTree ");
            soapEnvelope.Append(cuahsiXmlns);
            soapEnvelope.Append(@"><conceptKeyword>Hydrosphere</conceptKeyword></getOntologyTree>");
            soapEnvelope.Append(soapEnvelopeClosing);

            watch1.Reset();
            watch1.Start();
            SoapHelper.HttpSOAPToFile(_asmxURL, soapEnvelope.ToString(), soapAction, xmlFileName);
            watch1.Stop();
            Debug.WriteLine("DownloadOntologyTree: " + watch1.ElapsedMilliseconds);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns the series catalog for the specified region (latitude | longitude bounding box)
        /// </summary>
        /// <param name="latLongBox">the latitude/longitude bounding box</param>
        /// <param name="keyword">search keyword (not included in search criteria if null)</param>
        /// <param name="beginDate">the begin date</param>
        /// <param name="endDate">the end date</param>
        /// <param name="networkIDs">the ServiceIDs. These are obtained by calling GetServicesInBox() function</param>
        /// <param name="xmlFileName">the xml file name where to save results</param>
        public void GetSeriesCatalogForBoxXml(Box latLongBox, string keyword, DateTime beginDate, DateTime endDate, int[] networkIDs, string xmlFileName)
        {
            string soapAction = cuahsiSoapAction + "GetSeriesCatalogForBox2";

            StringBuilder soap = new StringBuilder();

            soap.Append(soapEnvelopeHeader);
            soap.Append(@"<GetSeriesCatalogForBox2 ");
            soap.Append(cuahsiXmlns);
            soap.Append(@">");
            soap.Append(@"<xmin>");
            soap.Append(latLongBox.XMin.ToString());
            soap.Append(@"</xmin>");
            soap.Append(@"<xmax>");
            soap.Append(latLongBox.XMax.ToString());
            soap.Append(@"</xmax>");
            soap.Append(@"<ymin>");
            soap.Append(latLongBox.YMin.ToString());
            soap.Append(@"</ymin>");
            soap.Append(@"<ymax>");
            soap.Append(latLongBox.YMax.ToString());
            soap.Append(@"</ymax>");
            if (string.IsNullOrEmpty(keyword))
            {
                soap.Append(@"<conceptKeyword/>");
            }
            else
            {
                soap.Append(@"<conceptKeyword>");
                soap.Append(keyword);
                soap.Append(@"</conceptKeyword>");
            }

            if (networkIDs == null)
            {
                soap.Append(@"<networkIDs/>");
            }
            else if (networkIDs.Length == 0)
            {
                soap.Append(@"<networkIDs/>");
            }
            else
            {
                soap.Append(@"<networkIDs>");
                for (int i = 0; i < networkIDs.Length; i++)
                {
                    soap.Append(networkIDs[i].ToString());
                    if (i < networkIDs.Length - 1)
                    {
                        soap.Append(",");
                    }
                }
                soap.Append(@"</networkIDs>");
            }
            soap.Append(@"<beginDate>");
            soap.Append(beginDate.Month.ToString());
            soap.Append("/");
            soap.Append(beginDate.Day.ToString());
            soap.Append("/");
            soap.Append(beginDate.Year.ToString());
            soap.Append(@"</beginDate>");

            soap.Append(@"<endDate>");
            soap.Append(endDate.Month.ToString());
            soap.Append("/");
            soap.Append(endDate.Day.ToString());
            soap.Append("/");
            soap.Append(endDate.Year.ToString());
            soap.Append(@"</endDate>");

            soap.Append(@"</GetSeriesCatalogForBox2>");
            soap.Append(soapEnvelopeClosing);

            watch1.Start();
            SoapHelper.HttpSOAPToFile(_asmxURL, soap.ToString(), soapAction, xmlFileName);
            watch1.Stop();
            Debug.WriteLine("GetSeriesCatalogForBox: " + watch1.ElapsedMilliseconds);
        }