handling exceptions in asynchronous web service calls

D

Doug Perkes

I have a win forms application that calls a web service
asynchronously. Occassionally, the web service call with raise an
exception. Unfortunately, since I am calling it asynchronously, I
haven't been able to find a good way to handle exceptions.

Can anyone point me in the right direction?

Thanks,

Doug
 
J

Jeffrey Hasan

Is the nature of your question more design-oriented? Meaning, are you asking
how to gracefully handle asynchronous errors once the user is already doing
something else in the WinForms app? Depending on the nature of the
information, you may want to switch the Web service call to be synchronous
rather than asynchronous. Alternatively, there is a hybrid broker/service
agent approach, whereby you make a synchronous call to a broker, which in
turn makes asynchronous calls to a number of web services and aggregates the
results. You are limited to waiting for the longest running Web service
operation, but at least the results are returned to you all at once by the
broker.

If you are looking to make single asynchronous calls, then exception
handling will always be problematic, because you cannot control the timing
of a return error with a coordinated response, since it's not clear what the
application user will be doing when the error returns. My recommendation is
to go synchronous, or, if it is possible, aggregate your asynchronous Web
service calls with a synchronously called broker.

Jeffrey Hasan, MCSD
President, Bluestone Partners, Inc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top