473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Event handling for asynchronous calls

I'm developing WinForms application in .NET 2.0 that talks to web
service. The automatically generated proxy (reference class) has got
methods for both synchronous and asynchronous invocations of the web
service methods. What I like about the asynchronous calls that they
use events. So when I call the web service operation is finished is
fires the event. So all my objects that I'm using in my client
application just subscribe to whatever event they need.
Previously we used the synchronous calls and we just inherited this
proxy (reference class) and overwrote the Invoke method (all
synchronous calls go through this one method) so we can easily trap
exceptions. Whenever we had a WebException or SoapException we dealt
with it in this one spot. But when we're using the asynchronous
invocation there's no such a place. I can overwrite the InvokeAsync
method but that doesn't help me with the SoapExceptions that I'm
getting from the response. As a result of that - in every event
handler I need to try/catch for every possible error and I don't have
the error trapping in one place. I'm not sure how the process works
properly but whenever I get SoapException the event is fired from the
proxy (reference object), it gets to my event handler but then it
crashes.
What is the design approach for this - am I doing something wrong? I
just want to have centralized exception trapping but don't know how to
do it for asynchronous calls.
Thanks for any help
Jan

Jun 15 '07 #1
1 1752
ja********@gmail.com wrote in news:1181891280.444153.171100
@n15g2000prd.googlegroups.com:
What is the design approach for this - am I doing something wrong? I
just want to have centralized exception trapping but don't know how to
do it for asynchronous calls.
Nope - Unfortunately doesn't look like MS provided a rich error handling
framework :-(

It wouldn't have been hard for MS to include a "OnError" event.
Jun 26 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marcin Kielar | last post by:
hello i'm searching for algorithm able to detect and resolve conflicts during recursive event propagation. I'd like to implement small message passing framework without using message queue -...
2
by: Srinath Avadhanula | last post by:
Hello, I am wondering if QT has something like QWaitForNextEvent() function. This function would block execution of the application till another key was pressed and then return the event...
3
by: Anand Pillai | last post by:
This is for folks who are familiar with asynchronous event handling in Python using the asyncore module. If you have ever used the asyncore module, you will realize that it's event loop does not...
18
by: Elder Hyde | last post by:
Hey all, A class of mine needs to tell the outside world when its buffer is not empty. The problem is that C# seems to force you to put the event-raising code in the base class. To illustrate,...
13
by: ALI-R | last post by:
Hi All, When we say events are processed asynchronously in for instance Sharepoint ,what dose it mean? Thanks for your help. Ali
4
by: dave_wurtz | last post by:
All, First a little information... I have a class library that was developed for a GUI application that I am trying to get to work on my ASP.NET application. The library essentially is used to...
3
by: nt8jbwu02 | last post by:
I am trying to use the example at: http://msdn2.microsoft.com/en-us/library/ms171728(d=ide).aspx to update a control in a thread safe maner. The article shows a couple of ways to do so and...
2
by: Kevin Walzer | last post by:
I'm porting a Tkinter application to wxPython and had a question about wxPython's event loop. The Tkinter app provides a GUI to a command-line tool. It gathers user input, and opens an...
0
by: marian.kovac | last post by:
Hi, I have this simple sample code: class SearchRange { static int m = 0; static void Main(string args) { Discover discover = new Discover(); // Add discovered device handler
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.