By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,600 Members | 1,683 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,600 IT Pros & Developers. It's quick & easy.

Error trapping for web service asynchronous calls

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a

<ja********@gmail.comwrote in message
news:11*********************@j4g2000prf.googlegrou ps.com...
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
You should post to MS.Public.dotnet.framework.webservices.

Jun 15 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.