// CryoNet SOAP Search Client, written in C#.NET // http://www.cryonet.org/soap/ // Kevin Q. Brown, July, 2003 using System.Diagnostics; using System.Xml.Serialization; using System; using System.Web.Services.Protocols; using System.ComponentModel; using System.Web.Services; using System.Data; /// [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="SoapSearchClientSoap", Namespace="http://www.cryonet.org/soap/")] public class SoapSearchClient : System.Web.Services.Protocols.SoapHttpClientProtocol { /// public SoapSearchClient() { this.Url = "http://www.cryonet.org/cgi-bin/soap.cgi"; } /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.cryonet.org/soap/search", RequestNamespace="http://www.cryonet.org/soap/", ResponseNamespace="http://www.cryonet.org/soap/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] [System.Runtime.Remoting.Metadata.SoapMethodAttribute(SoapAction="soap#search")] public System.Data.DataSet search(string searchStr, string sortOrder, int startDisp, int numDisp, int minNmbr, int maxNmbr) { object[] results = this.Invoke("search", new object[] { searchStr, sortOrder, startDisp, numDisp, minNmbr, maxNmbr}); return ((System.Data.DataSet)(results[0])); } } public class testclass { public static void Main() { SoapSearchClient ssc = new SoapSearchClient(); DataSet ds = null; try { ds = ssc.search("liquid nitrogen", // searchStr = search string "new", // sortOrder can be "new", "old", or "rank" 11, // startDisp = start display at this match 10, // numDisp = number of matches to display 0, // minNmbr = minimum CryoNet message # for match 99999); // maxNmbr = maximum CryoNet message # for match } catch (Exception ex) { Console.WriteLine("Error: " + ex.Message); return; } if (ds == null) { Console.WriteLine("No dataset returned."); return; } if (ds.Tables.Count == 0) { Console.WriteLine("No tables in dataset."); return; } // loop through each table int ntable = ds.Tables.Count; for (int k=0; k