Wednesday, May 14, 2008

Web Services Running Asynchronously?

On and off over the last few days, I've been attempting to find ways to let a web method request wait for completion of a few tasks before returning a result to the browser. There are several cases where a thread from the thread pool can be on-hold or blocking while nothing is happening. In away, what I've been looking for is event-driven web services.

For example, when a Web Service (MyWebService) is attempting to access an external web service (TheirWebService) MyWebService will continue to hang onto a thread while TheirWebService is pending completion. To return resources to the thread pool, a developer can make use of server-side asynchronous web methods. I found an article on MSDN from Matt Powell (of course it's very old) that outlines how to do it. My results where mixed however. When I used an ASMX accessed via AJAX web service calls, the call continued to be returned and the javascript always got back the IAsyncResult.

For my test, the ASMX file was in the same project as the ASPX/AJAX page. I'm not exactly certain why the result was always returned, but I believe Visual Studio does some funky inspection of methods and builds a js proxy to call those methods. At any rate, I believe this method will assist in future efforts (like implementing an event-driven server-side push methodology). But thus far, it remains only cool in concept.

Friday, May 09, 2008

Multiple Sclerosis (MS) Walk in Bozeman

Tomorrow we are hitting the street to do the National Multiple Sclerosis Society walk. It's a four mile course with kids in-tow, so I'm sure we'll be at it for a while. The reason I mention it here is in case anyone feels the desire to donate in the fight against MS. My wife is on the volunteer list and can be reached at the national ms website. I know the event is tomorrow, but anyone can pledge an amount until June.

Also, thanks to all that have contributed already. To date, we have $315 to contribute as an individual and $2,000 as a team.

As for normal blogging, don't worry. My next post will return to its regularly semi-geeky content.