views:

40

answers:

2

Hi, I invoke a server side method (by jQuery's $.ajax) which invokes an asynchronous WebService long-running method. The problem is, that while that long-running method is not complete, I can't get the progress of that method for my progress bar. Why server waits until the method completes ?

[Solved] !

ThreadPool.QueueUserWorkItem(state => service.MyMethod());

that code makes that my webserver doesn't wait for method complete, the progress bar is being updated. Only 1 code line.....

+1  A: 

This is almost the same answer - to a different question.

The solution is to add "Web Gardern", or "Web Pool", means more working pools and threads, because every pool is thread safe and must wait to end until the next one call.

Aristos
so, then there is no posibility to get the current progress of the operation until its completes ?
Tony
@Tony There is a possibility to get the current progress of the operation using new thread inside the request. By default the request made on the same thread, but you can create a new thread to make the work - is simple, need synchronization and some tests, but you can do it - and now I see that you find it. Nice way, I use simple threads, nice idea...
Aristos
A: 

@Tony, Which server is waiting, the web server for the site or the webservice hosting the "asynchronous" method?

SargeATM
the web site server
Tony
@SargeATM I think that this is not an answer but a question to the question, and for that reason exist the comments.
Aristos
I might be totally daft here but how do I leave a comment? Do I have to have a certain reputation before I can do that?
SargeATM