Creating an ASP.NET web services and consuming it with a Win Form  
<< Back Page 3

Drop a label and a button on the form. Double click the button to generate a Click event and then modify the event so it looks like this below.

private void button1_Click(object sender, System.EventArgs e)
{
com.sapago.www.Services myService = new
      SPWebServices.com.sapago.www.Services();
label1.Text = myService.ServerTime();
}

When you myService and type a period Visual Studio’s IntelliSense will give you the name of the methods you can call.

Launch you application and click the button. Each button click will instantiate a new instance of the web service and call the method finally assigning the value you client receives back to the text property of your label.

Win Form web service client



Facebook •  Twitter •  LinkedIn •  Windows Live Space •  Plaxo •  MSN  •  Channel9 •  Spock  •  Google •  Programmer's Heaven  •   Variable Markup  •  San24  •  Yahoo Profile  •  Excite UK  •  Amazon  •  Google Search  •  TGZ  •  Google •  ExciteUK  •  Angelfire  •  Canadian Content  •  411 ASP  •   Interactiva