Async Call to WebService

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?

2 Comments

  • 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

  • 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.

Comments have been disabled for this content.