i have a c# wcf web service and a c# client which makes calls to the web service which is working fine and have a scenario like below which i am unable to figure it out how to do it.
Here is the case, i have 2 methods in c# client as the 1st method will make more time and client doesn’t know what going on as response from the wcf web service will take long time, so we implemented 2nd method which gives the status of the 1st method call(saying that the first method has a total of 10 tasks and is currently performing 1 or 2 or 3 etc). now i don’t have any idea how the call goes to the 2nd method as the first method is not yet completed and as both the methods have to be in the same client. Can any one please help with this.
If I have understand correctly… you need to implement asynchronous invocation.
By default in WCF all calls are synchronous.
What you have now is a synchronous invocation.:
What you need is:
Method2
2.1 Validate that request is correctly formed
2.2 Creates a thread with working process
2.3 Returns true (that means ok, I have queued your request)
2.4 Method1 continue doing its stuff.
Then you have two options:
You can check this MSDN link about how to implement asynchronous methods in WCF.