<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>A Simplified Asynchronous Call Pattern for WinForm Applications</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx</link><description>Web service calls from a WinForm client application have to be made asynchronously or you risk freezing the UI and annoying the user. But, making an asynchronous web service call using the default call pattern is needlessly complicated and a simpler call</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: A Simplified Asynchronous Call Pattern for WinForm Applications</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#43299</link><pubDate>Sat, 13 Dec 2003 06:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:43299</guid><dc:creator>manish</dc:creator><description>Can this be extended/used with Web form application ???&lt;br&gt;-Manish&lt;br&gt;manishgo_in@hotmail.com</description></item><item><title>re: A Simplified Asynchronous Call Pattern for WinForm Applications</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#43443</link><pubDate>Sun, 14 Dec 2003 07:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:43443</guid><dc:creator>David Hill</dc:creator><description>As described, this technique will not work from a web form because the calling object has to be around when the asynchronous call finishes so the callback method can be invoked. For a web form this will not be case (unless you block the thread, which you should never do!) because it is a transient object just created to service a single web request.&lt;br&gt;&lt;br&gt;There is a great article on MSDN which describes what you need to do in the WebForm case...&lt;br&gt;&lt;br&gt;&lt;a target="_new" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service07222003.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service07222003.asp&lt;/a&gt;&lt;br&gt;&lt;br&gt;So, if you are calling a web service, or any kind of lengthy call, from an ASPX page, then you need to do the call asynchronously from within a PreRequestHandler. It's all a bit complicated but the performance gains are worth it...&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>re: A Simplified Asynchronous Call Pattern for WinForm Applications</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#43555</link><pubDate>Mon, 15 Dec 2003 04:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:43555</guid><dc:creator>manish</dc:creator><description>Thanks a lot David for the link and explanation...&lt;br&gt;-Manish</description></item><item><title>re: A Simplified Asynchronous Call Pattern for WinForm Applications</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#48596</link><pubDate>Thu, 08 Jan 2004 13:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:48596</guid><dc:creator>Hal Pierson</dc:creator><description>Generics will simplify the service agent.&lt;br&gt;In the mean time, perhaps one of the &amp;quot;templated&amp;quot; code generators could be used.</description></item><item><title>Service Agents as a best practice pattern to call Web services</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#49420</link><pubDate>Sat, 10 Jan 2004 18:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:49420</guid><dc:creator>Christian Weyer: Web Services </dc:creator><description /></item><item><title>Online Software Design Pattern Links</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#76582</link><pubDate>Fri, 20 Feb 2004 02:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:76582</guid><dc:creator> anu(e)scape</dc:creator><description> Patterns and Pattern Languages are ways to describe best practices, good designs, and capture experience in a way that...</description></item><item><title>re: A Simplified Asynchronous Call Pattern for WinForm Applications</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#92658</link><pubDate>Fri, 19 Mar 2004 14:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:92658</guid><dc:creator>Oskar Austegard</dc:creator><description>Saw your article on MSDN - (looks promising, I gave you an 8), and the ServiceAgent class looks like a good candidate for code generation based on reflection of the underlyin WebService proxy class.&lt;br&gt;&lt;br&gt;But - Is there a typo/bug in the ServiceAgent example code?  Sholdn't the call in GetCustomerDataCallback be to GetCustomerDataCompletedCallback and not to GetCustomersCompletedCallback?&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;&lt;br&gt;Oskar</description></item><item><title>re: A Simplified Asynchronous Call Pattern for WinForm Applications</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#93194</link><pubDate>Sat, 20 Mar 2004 14:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:93194</guid><dc:creator>Derek Woo</dc:creator><description>I like your article. And in fact part of the idea is being implemented in my app in hand.&lt;br&gt;&lt;br&gt;But my problem is that, there is no way, from the GUI point of view, to catch exceptions raised by the webservice proxy. Because it's now intercepted by the ServiceAgent. Probably it's possible to supply a callback for failed webservice invoke. But then that complicates the interface and looks ugly. Do you have any idea of how to solve this problem? Any way to route the exceptions back to the callback function supplied by the GUI class?&lt;br&gt;&lt;br&gt;-Derek</description></item><item><title>Any chance to get AutoCallbackServiceAgent working on Compact Framework?</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#113036</link><pubDate>Wed, 14 Apr 2004 13:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:113036</guid><dc:creator>Mathias Fritsch</dc:creator><description>I saw the article on msdn and it worked fine. It would fit perfectly into my CFW - Project. Anybody tried to get it working?&lt;br&gt;(no Delegate.CreateDelegate )&lt;br&gt;&lt;br&gt;Mathias Fritsch&lt;br&gt;</description></item><item><title>re: A Simplified Asynchronous Call Pattern for WinForm Applications</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#124063</link><pubDate>Fri, 30 Apr 2004 18:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:124063</guid><dc:creator>Senthil</dc:creator><description>BackgroundWorker for .NET 1.1 (www.idesign.net) can be used to solve the same problem.</description></item><item><title>re: A Simplified Asynchronous Call Pattern for WinForm Applications</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#151598</link><pubDate>Wed, 09 Jun 2004 10:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:151598</guid><dc:creator>Furty</dc:creator><description>Just musing, do MS pay you when they republish your copyrighted work on MSDN, or do they simply offer you the fame/glory? :)</description></item><item><title>re: A Simplified Asynchronous Call Pattern for WinForm Applications</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#172148</link><pubDate>Fri, 02 Jul 2004 22:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:172148</guid><dc:creator>hak</dc:creator><description>Great article. I have one question about Asychronous call and SQL CE. &lt;br&gt;When Asychronous call comes back and updates SQL CE and UI thread is about to access SQL CE at the same time, because SQL CE allows only one connection, the application will blow up? Do you have any thought on this? Thank you</description></item><item><title>re: A Simplified Asynchronous Call Pattern for WinForm Applications</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#176537</link><pubDate>Thu, 08 Jul 2004 08:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:176537</guid><dc:creator>David Hill</dc:creator><description>If you can only access the database on a single thread, then you have a few options.&lt;br&gt;&lt;br&gt;You could use the UI thread to update and query the database, passing data from the background thread to the UI thread for it to update the UI and access the local database. This is not very elegant and using the UI thread to update and access a database is generally to be avoided, but if the database is local then you might get away with it.&lt;br&gt;&lt;br&gt;The alternative is to create a single background thread which is responsible for managing the database and then use this to query and update the database. Both the UI and other background threads will interact with this manager thread to get data into and out of the database.&lt;br&gt;&lt;br&gt;I guess a third option would be to close and re-open the connection for each time you access the database...</description></item><item><title>re: A Simplified Asynchronous Call Pattern for WinForm Applications</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#180877</link><pubDate>Mon, 12 Jul 2004 18:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:180877</guid><dc:creator>Sergio</dc:creator><description>I am guessing this will not work in the .net compact framework.  Is that true?  Are there other options?&lt;br&gt;&lt;br&gt;&lt;br&gt;thanks</description></item><item><title>Making a Rich Client Smart : Using Multiple Threads</title><link>http://blogs.msdn.com/dphill/pages/43260.aspx#183504</link><pubDate>Thu, 15 Jul 2004 00:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:183504</guid><dc:creator>David Hill's WebLog - Smart Clients For Smart User</dc:creator><description /></item></channel></rss>