public void DoWork() { return; }
为
public string SayHello(string userName) { return userName + ",hello world!!"; }
4.生成一下;
private void button1_Click(object sender, RoutedEventArgs e) { ServiceReference1.Service1Client ws = new ServiceReference1.Service1Client(); ws.SayHelloCompleted += new EventHandler<ServiceReference1.SayHelloCompletedEventArgs>(SayHelloCompleted); ws.SayHelloAsync(textbox1.Text); } void SayHelloCompleted(object sender, ServiceReference1.SayHelloCompletedEventArgs e) { label1.Content = e.Result; }
8.Just run it!
silverlight+WCF入门教程,布布扣,bubuko.com
原文:http://www.cnblogs.com/aswordok/p/wcf.html