User-2057865890 posted
Hi Nrk_hi,
You could start from the following article.
Asynchronous Operations in WCF
http://social.technet.microsoft.com/wiki/contents/articles/16346.asynchronous-operations-in-wcf.aspx
[ServiceContract]
public interface IService1
{
//event-based asynchronous pattern
[OperationContract]
string GetData(string message);
}
public class Service1 : IService1
{
public string GetData(string message)
{
Thread.Sleep(5000);
return message;
}
}
class Program
{
static wsService1.Service1Client client1 = new wsService1.Service1Client();
static void Main(string[] args)
{
client1.GetDataCompleted += client_GetDataCompleted;
client1.GetDataAsync("event-based asynchronous pattern");
Console.WriteLine("Waiting for async operation...");
Console.ReadLine();
}
static void client_GetDataCompleted(object sender, wsService1.GetDataCompletedEventArgs e)
{
Console.WriteLine(e.Result.ToString());
}
}
Best Regards,
Chris