//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.42 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ using System; using System.ComponentModel; using System.Diagnostics; using System.Web.Services; using System.Web.Services.Protocols; using System.Xml.Serialization; // // This source code was auto-generated by wsdl, Version=2.0.50727.42. // /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="GoogleSearchBinding", Namespace="urn:GoogleSearch")] [System.Xml.Serialization.SoapIncludeAttribute(typeof(ResultElement))] public partial class GoogleSearchService : System.Web.Services.Protocols.SoapHttpClientProtocol { private System.Threading.SendOrPostCallback doGetCachedPageOperationCompleted; private System.Threading.SendOrPostCallback doSpellingSuggestionOperationCompleted; private System.Threading.SendOrPostCallback doGoogleSearchOperationCompleted; /// public GoogleSearchService() { this.Url = "http://api.google.com/search/beta2"; } /// public event doGetCachedPageCompletedEventHandler doGetCachedPageCompleted; /// public event doSpellingSuggestionCompletedEventHandler doSpellingSuggestionCompleted; /// public event doGoogleSearchCompletedEventHandler doGoogleSearchCompleted; /// [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:GoogleSearchAction", RequestNamespace="urn:GoogleSearch", ResponseNamespace="urn:GoogleSearch")] [return: System.Xml.Serialization.SoapElementAttribute("return", DataType="base64Binary")] public byte[] doGetCachedPage(string key, string url) { object[] results = this.Invoke("doGetCachedPage", new object[] { key, url}); return ((byte[])(results[0])); } /// public System.IAsyncResult BegindoGetCachedPage(string key, string url, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("doGetCachedPage", new object[] { key, url}, callback, asyncState); } /// public byte[] EnddoGetCachedPage(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((byte[])(results[0])); } /// public void doGetCachedPageAsync(string key, string url) { this.doGetCachedPageAsync(key, url, null); } /// public void doGetCachedPageAsync(string key, string url, object userState) { if ((this.doGetCachedPageOperationCompleted == null)) { this.doGetCachedPageOperationCompleted = new System.Threading.SendOrPostCallback(this.OndoGetCachedPageOperationCompleted); } this.InvokeAsync("doGetCachedPage", new object[] { key, url}, this.doGetCachedPageOperationCompleted, userState); } private void OndoGetCachedPageOperationCompleted(object arg) { if ((this.doGetCachedPageCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.doGetCachedPageCompleted(this, new doGetCachedPageCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } /// [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:GoogleSearchAction", RequestNamespace="urn:GoogleSearch", ResponseNamespace="urn:GoogleSearch")] [return: System.Xml.Serialization.SoapElementAttribute("return")] public string doSpellingSuggestion(string key, string phrase) { object[] results = this.Invoke("doSpellingSuggestion", new object[] { key, phrase}); return ((string)(results[0])); } /// public System.IAsyncResult BegindoSpellingSuggestion(string key, string phrase, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("doSpellingSuggestion", new object[] { key, phrase}, callback, asyncState); } /// public string EnddoSpellingSuggestion(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } /// public void doSpellingSuggestionAsync(string key, string phrase) { this.doSpellingSuggestionAsync(key, phrase, null); } /// public void doSpellingSuggestionAsync(string key, string phrase, object userState) { if ((this.doSpellingSuggestionOperationCompleted == null)) { this.doSpellingSuggestionOperationCompleted = new System.Threading.SendOrPostCallback(this.OndoSpellingSuggestionOperationCompleted); } this.InvokeAsync("doSpellingSuggestion", new object[] { key, phrase}, this.doSpellingSuggestionOperationCompleted, userState); } private void OndoSpellingSuggestionOperationCompleted(object arg) { if ((this.doSpellingSuggestionCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.doSpellingSuggestionCompleted(this, new doSpellingSuggestionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } /// [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:GoogleSearchAction", RequestNamespace="urn:GoogleSearch", ResponseNamespace="urn:GoogleSearch")] [return: System.Xml.Serialization.SoapElementAttribute("return")] public GoogleSearchResult doGoogleSearch(string key, string q, int start, int maxResults, bool filter, string restrict, bool safeSearch, string lr, string ie, string oe) { object[] results = this.Invoke("doGoogleSearch", new object[] { key, q, start, maxResults, filter, restrict, safeSearch, lr, ie, oe}); return ((GoogleSearchResult)(results[0])); } /// public System.IAsyncResult BegindoGoogleSearch(string key, string q, int start, int maxResults, bool filter, string restrict, bool safeSearch, string lr, string ie, string oe, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("doGoogleSearch", new object[] { key, q, start, maxResults, filter, restrict, safeSearch, lr, ie, oe}, callback, asyncState); } /// public GoogleSearchResult EnddoGoogleSearch(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((GoogleSearchResult)(results[0])); } /// public void doGoogleSearchAsync(string key, string q, int start, int maxResults, bool filter, string restrict, bool safeSearch, string lr, string ie, string oe) { this.doGoogleSearchAsync(key, q, start, maxResults, filter, restrict, safeSearch, lr, ie, oe, null); } /// public void doGoogleSearchAsync(string key, string q, int start, int maxResults, bool filter, string restrict, bool safeSearch, string lr, string ie, string oe, object userState) { if ((this.doGoogleSearchOperationCompleted == null)) { this.doGoogleSearchOperationCompleted = new System.Threading.SendOrPostCallback(this.OndoGoogleSearchOperationCompleted); } this.InvokeAsync("doGoogleSearch", new object[] { key, q, start, maxResults, filter, restrict, safeSearch, lr, ie, oe}, this.doGoogleSearchOperationCompleted, userState); } private void OndoGoogleSearchOperationCompleted(object arg) { if ((this.doGoogleSearchCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.doGoogleSearchCompleted(this, new doGoogleSearchCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } /// public new void CancelAsync(object userState) { base.CancelAsync(userState); } } /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.SoapTypeAttribute(Namespace="urn:GoogleSearch")] public partial class GoogleSearchResult { private bool documentFilteringField; private string searchCommentsField; private int estimatedTotalResultsCountField; private bool estimateIsExactField; private ResultElement[] resultElementsField; private string searchQueryField; private int startIndexField; private int endIndexField; private string searchTipsField; private DirectoryCategory[] directoryCategoriesField; private double searchTimeField; /// public bool documentFiltering { get { return this.documentFilteringField; } set { this.documentFilteringField = value; } } /// public string searchComments { get { return this.searchCommentsField; } set { this.searchCommentsField = value; } } /// public int estimatedTotalResultsCount { get { return this.estimatedTotalResultsCountField; } set { this.estimatedTotalResultsCountField = value; } } /// public bool estimateIsExact { get { return this.estimateIsExactField; } set { this.estimateIsExactField = value; } } /// public ResultElement[] resultElements { get { return this.resultElementsField; } set { this.resultElementsField = value; } } /// public string searchQuery { get { return this.searchQueryField; } set { this.searchQueryField = value; } } /// public int startIndex { get { return this.startIndexField; } set { this.startIndexField = value; } } /// public int endIndex { get { return this.endIndexField; } set { this.endIndexField = value; } } /// public string searchTips { get { return this.searchTipsField; } set { this.searchTipsField = value; } } /// public DirectoryCategory[] directoryCategories { get { return this.directoryCategoriesField; } set { this.directoryCategoriesField = value; } } /// public double searchTime { get { return this.searchTimeField; } set { this.searchTimeField = value; } } } /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.SoapTypeAttribute(Namespace="urn:GoogleSearch")] public partial class ResultElement { private string summaryField; private string uRLField; private string snippetField; private string titleField; private string cachedSizeField; private bool relatedInformationPresentField; private string hostNameField; private DirectoryCategory directoryCategoryField; private string directoryTitleField; /// public string summary { get { return this.summaryField; } set { this.summaryField = value; } } /// public string URL { get { return this.uRLField; } set { this.uRLField = value; } } /// public string snippet { get { return this.snippetField; } set { this.snippetField = value; } } /// public string title { get { return this.titleField; } set { this.titleField = value; } } /// public string cachedSize { get { return this.cachedSizeField; } set { this.cachedSizeField = value; } } /// public bool relatedInformationPresent { get { return this.relatedInformationPresentField; } set { this.relatedInformationPresentField = value; } } /// public string hostName { get { return this.hostNameField; } set { this.hostNameField = value; } } /// public DirectoryCategory directoryCategory { get { return this.directoryCategoryField; } set { this.directoryCategoryField = value; } } /// public string directoryTitle { get { return this.directoryTitleField; } set { this.directoryTitleField = value; } } } /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.SoapTypeAttribute(Namespace="urn:GoogleSearch")] public partial class DirectoryCategory { private string fullViewableNameField; private string specialEncodingField; /// public string fullViewableName { get { return this.fullViewableNameField; } set { this.fullViewableNameField = value; } } /// public string specialEncoding { get { return this.specialEncodingField; } set { this.specialEncodingField = value; } } } /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void doGetCachedPageCompletedEventHandler(object sender, doGetCachedPageCompletedEventArgs e); /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class doGetCachedPageCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; internal doGetCachedPageCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } /// public byte[] Result { get { this.RaiseExceptionIfNecessary(); return ((byte[])(this.results[0])); } } } /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void doSpellingSuggestionCompletedEventHandler(object sender, doSpellingSuggestionCompletedEventArgs e); /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class doSpellingSuggestionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; internal doSpellingSuggestionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } /// public string Result { get { this.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } } /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void doGoogleSearchCompletedEventHandler(object sender, doGoogleSearchCompletedEventArgs e); /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class doGoogleSearchCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; internal doGoogleSearchCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } /// public GoogleSearchResult Result { get { this.RaiseExceptionIfNecessary(); return ((GoogleSearchResult)(this.results[0])); } } }