Windows CE 设备应用程序里动态引用webservice

来源:互联网 发布:淘宝店招在线生成 编辑:程序博客网 时间:2024/06/06 15:47

        private void button1_Click(object sender, EventArgs e)
        {
            string tmp = new userManager().Hello("tz");
            MessageBox.Show(tmp);
        }

 

//------------------------------------------------------------------------------
// <auto-generated>
//     此代码由工具生成。
//     运行时版本:2.0.50727.8000
//
//     对此文件的更改可能会导致不正确的行为,并且如果
//     重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------

//
// 此源代码由 wsdl 自动生成, Version=2.0.50727.1432。
//
namespace TestDemo {
    using System.Xml.Serialization;
    using System.Web.Services;
    using System.ComponentModel;
    using System.Web.Services.Protocols;
    using System;
    using System.Diagnostics;
   
   
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="userManagerSoap", Namespace="http://tempuri.org/")]
    public partial class userManager : System.Web.Services.Protocols.SoapHttpClientProtocol {
       
        //private System.Threading.SendOrPostCallback CheckUserOperationCompleted;
       
        //private System.Threading.SendOrPostCallback UpdatePassWordOperationCompleted;
       
        //private System.Threading.SendOrPostCallback UpdateLactionOperationCompleted;
       
        //private System.Threading.SendOrPostCallback GetPersonInfoOperationCompleted;
       
        /// <remarks/>
        public userManager() {
            this.Url = "http://nongji.tianzestar.com:1380/data/userManager.asmx";
        }
       
        ///// <remarks/>
        //public event CheckUserCompletedEventHandler CheckUserCompleted;
       
        ///// <remarks/>
        //public event UpdatePassWordCompletedEventHandler UpdatePassWordCompleted;
       
        ///// <remarks/>
        //public event UpdateLactionCompletedEventHandler UpdateLactionCompleted;
       
        ///// <remarks/>
        //public event GetPersonInfoCompletedEventHandler GetPersonInfoCompleted;

        /// <remarks/>
       
        public string Hello(string sUser)
        {
            object[] results = this.Invoke("Hello", new object[] {
                        sUser});
            return ((string)(results[0]));
        }

        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CheckUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public void CheckUser(string username, string pwd) {
            this.Invoke("CheckUser", new object[] {
                        username,
                        pwd});
        }
       
        /// <remarks/>
        public System.IAsyncResult BeginCheckUser(string username, string pwd, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("CheckUser", new object[] {
                        username,
                        pwd}, callback, asyncState);
        }
       
        /// <remarks/>
        public void EndCheckUser(System.IAsyncResult asyncResult) {
            this.EndInvoke(asyncResult);
        }
       
        ///// <remarks/>
        //public void CheckUserAsync(string username, string pwd) {
        //    this.CheckUserAsync(username, pwd, null);
        //}
       
        ///// <remarks/>
        //public void CheckUserAsync(string username, string pwd, object userState) {
        //    if ((this.CheckUserOperationCompleted == null)) {
        //        this.CheckUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckUserOperationCompleted);
        //    }
        //    this.InvokeAsync("CheckUser", new object[] {
        //                username,
        //                pwd}, this.CheckUserOperationCompleted, userState);
        //}
       
        //private void OnCheckUserOperationCompleted(object arg) {
        //    if ((this.CheckUserCompleted != null)) {
        //        System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
        //        this.CheckUserCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
        //    }
        //}
       
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdatePassWord", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public void UpdatePassWord(string username, string newpwd, string oldpwd) {
            this.Invoke("UpdatePassWord", new object[] {
                        username,
                        newpwd,
                        oldpwd});
        }
       
        /// <remarks/>
        public System.IAsyncResult BeginUpdatePassWord(string username, string newpwd, string oldpwd, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("UpdatePassWord", new object[] {
                        username,
                        newpwd,
                        oldpwd}, callback, asyncState);
        }
       
        /// <remarks/>
        public void EndUpdatePassWord(System.IAsyncResult asyncResult) {
            this.EndInvoke(asyncResult);
        }
       
        ///// <remarks/>
        //public void UpdatePassWordAsync(string username, string newpwd, string oldpwd) {
        //    this.UpdatePassWordAsync(username, newpwd, oldpwd, null);
        //}
       
        ///// <remarks/>
        //public void UpdatePassWordAsync(string username, string newpwd, string oldpwd, object userState) {
        //    if ((this.UpdatePassWordOperationCompleted == null)) {
        //        this.UpdatePassWordOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdatePassWordOperationCompleted);
        //    }
        //    this.InvokeAsync("UpdatePassWord", new object[] {
        //                username,
        //                newpwd,
        //                oldpwd}, this.UpdatePassWordOperationCompleted, userState);
        //}
       
        //private void OnUpdatePassWordOperationCompleted(object arg) {
        //    if ((this.UpdatePassWordCompleted != null)) {
        //        System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
        //        this.UpdatePassWordCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
        //    }
        //}
       
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateLaction", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public void UpdateLaction(string username, string pwd, string lactionStr) {
            this.Invoke("UpdateLaction", new object[] {
                        username,
                        pwd,
                        lactionStr});
        }
       
        /// <remarks/>
        public System.IAsyncResult BeginUpdateLaction(string username, string pwd, string lactionStr, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("UpdateLaction", new object[] {
                        username,
                        pwd,
                        lactionStr}, callback, asyncState);
        }
       
        /// <remarks/>
        public void EndUpdateLaction(System.IAsyncResult asyncResult) {
            this.EndInvoke(asyncResult);
        }
       
        ///// <remarks/>
        //public void UpdateLactionAsync(string username, string pwd, string lactionStr) {
        //    this.UpdateLactionAsync(username, pwd, lactionStr, null);
        //}
       
        ///// <remarks/>
        //public void UpdateLactionAsync(string username, string pwd, string lactionStr, object userState) {
        //    if ((this.UpdateLactionOperationCompleted == null)) {
        //        this.UpdateLactionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateLactionOperationCompleted);
        //    }
        //    this.InvokeAsync("UpdateLaction", new object[] {
        //                username,
        //                pwd,
        //                lactionStr}, this.UpdateLactionOperationCompleted, userState);
        //}
       
        //private void OnUpdateLactionOperationCompleted(object arg) {
        //    if ((this.UpdateLactionCompleted != null)) {
        //        System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
        //        this.UpdateLactionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
        //    }
        //}
       
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetPersonInfo", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public void GetPersonInfo(string username, string pwd, string sqlWhere) {
            this.Invoke("GetPersonInfo", new object[] {
                        username,
                        pwd,
                        sqlWhere});
        }
       
        /// <remarks/>
        public System.IAsyncResult BeginGetPersonInfo(string username, string pwd, string sqlWhere, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetPersonInfo", new object[] {
                        username,
                        pwd,
                        sqlWhere}, callback, asyncState);
        }
       
        /// <remarks/>
        public void EndGetPersonInfo(System.IAsyncResult asyncResult) {
            this.EndInvoke(asyncResult);
        }
       
        ///// <remarks/>
        //public void GetPersonInfoAsync(string username, string pwd, string sqlWhere) {
        //    this.GetPersonInfoAsync(username, pwd, sqlWhere, null);
        //}
       
        ///// <remarks/>
        //public void GetPersonInfoAsync(string username, string pwd, string sqlWhere, object userState) {
        //    if ((this.GetPersonInfoOperationCompleted == null)) {
        //        this.GetPersonInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPersonInfoOperationCompleted);
        //    }
        //    this.InvokeAsync("GetPersonInfo", new object[] {
        //                username,
        //                pwd,
        //                sqlWhere}, this.GetPersonInfoOperationCompleted, userState);
        //}
       
        //private void OnGetPersonInfoOperationCompleted(object arg) {
        //    if ((this.GetPersonInfoCompleted != null)) {
        //        System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
        //        this.GetPersonInfoCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
        //    }
        //}
       
        ///// <remarks/>
        //public new void CancelAsync(object userState) {
        //    base.CancelAsync(userState);
        //}
    }
   
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
    public delegate void CheckUserCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
   
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
    public delegate void UpdatePassWordCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
   
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
    public delegate void UpdateLactionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
   
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
    public delegate void GetPersonInfoCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
}

0 0
原创粉丝点击