Note that there are some explanatory texts on larger screens.

plurals
  1. POcallback client not working in wcf wsdualhttpbinding
    text
    copied!<p>i have one wcf duplex service and two clients. the scenario is that client1 submits requests to wcf and wcf stores it in DB.client2 processes the request taking it from DB and sends the status to wcf service which thereby should notify the client1 about the status. the callback address of client1 is stored in a static variable.client2 notifies wcf but wcf doesnt notify client1. Any solutions pls. Thanks in advance</p> <p>service.cs:</p> <pre><code>public class Service1 : IService1 { static List&lt;IServiceCallback&gt; list = new List&lt;IServiceCallback&gt;(); static IServiceCallback Callbck; public bool GetData(int value) { int i = 0; string s= string.Format("You entered: {0}", value); Callbck = OperationContext.Current.GetCallbackChannel&lt;IServiceCallback&gt;(); i++; list.Add(Callbck); Ret("sss..."); return true; } public void Ret(string s) { foreach (var c in list) { Callbck.display(s); } } } </code></pre> <p>client1.cs:</p> <pre><code>class Program { static void Main(string[] args) { InstanceContext instance = new InstanceContext(new Handler()); Service1Client client = new Service1Client(instance); bool res = client.GetData(123); if (res) Console.WriteLine("true"); } } public class Handler :IService1Callback { public void display(string s) { Console.WriteLine(s); } } </code></pre> <p>client2.cs:</p> <pre><code>class Program { static void Main(string[] args) { int i = 0; i++; Display(); } public static void Display() { Console.WriteLine("hello"); InstanceContext context = new InstanceContext(new Handlerss()); Service1Client client = new Service1Client(context); client.Ret("done"); } } class Handlerss : IService1Callback { public void display(string s) { Console.WriteLine(s); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload