473,406 Members | 2,220 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,406 software developers and data experts.

Error trapping for web service 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 3018

<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
5
by: Marty McDonald | last post by:
I create and start several threads, each thread executes the same method - within the method, a web service is invoked. I find that the more threads I use, the longer it takes for all of the...
0
by: Jonathan Trevor | last post by:
Hi, I've found what appears to be a bug with ASP.NET web service method invocation - making it impossible to invoke and get the result of a synchronous web call after an asynchronous call has...
5
by: rgarf | last post by:
I have a C++ application that consumes a web service. I would like to call the web service asynchronously so my C++ application can do other processing in between. My proxy file does not have any...
0
by: denz | last post by:
Hi, Basically, in the client proxy that is refering to a web service, i want to be able to switch automatically and transparently, from one URL to another (location of the mirrored service) when...
0
by: Brad Wood | last post by:
Running a web service on 1.1. Even though I don't recieve any errors in the output of the service, I see a ThreadAbortException in the ide output window when it's debugging, "Thread was being...
2
by: Joe | last post by:
Hello All: I have an executable that makes several asynchronous calls to a web service. The executable increments a counter for each async Web service call and decrements the counter whenever...
1
by: Pooja | last post by:
Hi, I am calling a web service to get Latitude and Longitude by sending a zip code. This is happening inside a loop (2000 - 3000 times). After say 80 times, it gives me an error - The operation...
3
by: kebalex | last post by:
Hi, I've got a requirement to poll a web service for data but it needs to be done very frequently. The web service call is straight forward, it just returns a simple table of data with no more...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.