Async Call to WebService

Published 16 July 04 03:53 PM | mhawley

So I ran into a bit of a problem this afternoon when calling WebServices asynchronously. It seems that if the process that calls the webservice ends right after you call the web service asynchrously, the process stops the async call and never makes that call.

I know this to be the case because I did several different tests, one calling the method async, then doing a wait on the IAsyncResult. I also did a long loop afterwards...both of which worked just fine. It seems that since the process ends, it cuts off the async call.

Anyone have any insight on this problem?

Filed under:

Comments

# Mike Rusaw said on July 16, 2004 10:52 PM:

Make sure that you call the endInvoke() method for your request. In 1.1 it is now the fact that the CLR will be expecting you to do the clean up other there will be reseources with held until... So ialways create a callback method and process my endInvoke() there and I have thousnds of calls execute where the final step is to "fire and forget."

Just my two cents...

mr...
mikerusaw@comcast.net

# jon_galloway@yahoo.com (Jon Galloway) said on July 20, 2004 02:56 AM:

We had problems with this, too. It didn't seem to return immediately. We ended up just spinning off another thread to call the webservice synchronously, and that's worked well. So ours asynchronous on the calling side as opposed to asynchronous on the webserver side, but the end result (at least in our use case) is the same.

This Blog

News

.NET Links

Blogs I Read

Syndication