Last post May 10, 2012 11:14 PM by johnjalani
May 10, 2012 11:01 PM|johnjalani|LINK
Hi, please help me,
i have a WCF application with two methods, namely Process() and CancelProcess(), and i also have a WPF the consumes the WCF.
the idea is simple, in the WPF has "Process" button and "Cancel" button that calls the Process() and CancelProcess() methods from WCF respectively, i was trying to run the Process() which takes a while to complete, and when i try to press the cancel button
while the Process() is still running, the process should stop running. please see the Service.svc code below:
private bool _IsCancelled = false;
//with around 10,000+ records so this process do take a while to finish
public void Process(DataTable dt)
for (int i = 0; i < dt.Rows.Count; i++)
public void CancelProcess(bool value)
_IsCancelled = value;
the problem is that eventhough the CancelProcess is called, the _IsCancelled is still equal to "false"?
i also try the "WCF ConcurrencyMode" some thing like this:
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,ConcurrencyMode=ConcurrencyMode.Multiple)]
public class Service : IService ....
can anyone help me about this
May 10, 2012 11:14 PM|johnjalani|LINK
The attribute is the answer :)