如何引用webservice

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

/// <summary> /// User_WebService 的摘要说明 /// </summary> [System.Diagnostics.DebuggerStepThrough(), System.ComponentModel.DesignerCategory("code"),

  System.Web.Services.WebServiceBinding(Name = "", Namespace = "")]

public class User_WebService : user_service.Service {    

//static string User_ServiceURL = System.Configuration.ConfigurationManager.AppSettings["User_ServiceURL"];    

//static User_WebService SendService = new User_WebService(User_ServiceURL);

        public User_WebService()             : base()         {

            //设置默认webService的地址

            this.Url = "http://localhost:1102/webservice/Service.asmx";

        }

        public User_WebService(string webUrl)             : base()    

     {

            this.Url = webUrl;

        }

        #region 获取用户                

public static DataSet s_getUser()        

{     

                    DataSet ds=new DataSet();            

           string User_ServiceURL = System.Configuration.ConfigurationManager.AppSettings["User_ServiceURL"];  

           User_WebService SendService = new User_WebService(User_ServiceURL);

            ds=SendService.GetUser();            

return ds;        

}        

#endregion    

public static DataSet s_getZzjg()     {               

  DataSet ds = new DataSet();        

string User_ServiceURL = System.Configuration.ConfigurationManager.AppSettings["User_ServiceURL"];        

User_WebService SendService = new User_WebService(User_ServiceURL);        

ds = SendService.GetZzjg();        

return ds;     }    

public static DataSet s_getSb()    

{            

   DataSet ds = new DataSet();        

string User_ServiceURL = System.Configuration.ConfigurationManager.AppSettings["User_ServiceURL"];        

User_WebService SendService = new User_WebService(User_ServiceURL);        

ds = SendService.GetSb();        

return ds;     }

}

posted on 2013-03-02 09:49  中子持心  阅读(250)  评论(0编辑  收藏  举报

导航