calling a c# wcf webservice from c# client -
i have c# wcf web service , c# client makes calls web service working fine , have scenario below unable figure out how it.
here case, have 2 methods in c# client 1st method make more time , client doesn't know going on response wcf web service take long time, implemented 2nd method gives status of 1st method call(saying first method has total of 10 tasks , performing 1 or 2 or 3 etc). don't have idea how call goes 2nd method first method not yet completed , both methods have in same client. can 1 please this.
if have understand correctly... need implement asynchronous invocation. default in wcf calls synchronous.
what have synchronous invocation.:
- method1 (client) invokes method2 (server) have tasks done.
- method1 waits long time until method2 finishes
- method1 receives true (or whatever) method 2
- method 1can continue doing things.
what need is:
- method1 (client) calls method2 (server)
method2
2.1 validate request correctly formed
2.2 creates thread working process
2.3 returns true (that means ok, have queued request)
2.4 method1 continue doing stuff.
then have 2 options:
3a. when method2 finishes calls method in client report has finished (say method 3 in client)
3b. method1 query method in server (say method4 in server) see progress of task every x seconds , show on screen or whatever wants until finished.
you can check msdn link how implement asynchronous methods in wcf.
Comments
Post a Comment