protected void Button1_Click(object sender, EventArgs e) { Web_Service ExampleAPI = new Web_Service("http://localhost//rabws/"); string r = "5000"; string f = "45"; ExampleAPI.PreInvoke(); ExampleAPI.AddParameter("rabpop", r); // Case Sensitive! To avoid typos, just copy the WebMethod's signature and paste it ExampleAPI.AddParameter("foxpop", f); // all parameters are passed as strings try { ExampleAPI.Invoke("pop_inc"); // name of the WebMethod to call (Case Sentitive again!) } finally { ExampleAPI.PosInvoke(); } TextBox1.Text = ExampleAPI.ResultString; /* WebServiceInvoker invoker = new WebServiceInvoker(new Uri("http://localhost//rabws/")); string service = "rabws"; string method = "pop_inc"; string[] args = new string[] { "5000", "45" }; string result = invoker.InvokeMethod<string>(service, method, args); TextBox1.Text = result; */ }
protected void Button1_Click(object sender, EventArgs e) { Web_Service ExampleAPI = new Web_Service(txtUrl.Text); string r = txtRab.Text; string f = txtFox.Text; ExampleAPI.PreInvoke(); ExampleAPI.AddParameter("rabpop", r); // Case Sensitive! To avoid typos, just copy the WebMethod's signature and paste it ExampleAPI.AddParameter("foxpop", f); // all parameters are passed as strings try { ExampleAPI.Invoke("pop_inc"); // name of the WebMethod to call (Case Sentitive again!) } finally { ExampleAPI.PosInvoke(); } txtpop.Text = ExampleAPI.ResultString; }