delegate in asp.net

D

DAXU

Hello,

I have a web page which sends 40-50 requests to a web service, which
in turn should return me some data. However, recently the web service
(out of my control) has been really slow and I keeps on getting error
messages (e.g. sql timeout) from the web service.

I am thinking of as soon as I receive the error message from the web
service, I will abandon further web service requests. However, the way
I did before was to create a delegate and use begininvoke to send the
request (the reason is that I can send more requests asynchronously to
speed things up.
e.g. like this:
GetProductBrandCoverageAsync _GetProductBrandCoverageAsync = new
GetProductBrandCoverageAsync(_WsMamSoft.GetProductBrandCoverage);
_GetProductBrandCoverageAsync.BeginInvoke
(_ProductBrandCoverage, Model, new AsyncCallback
(InsertModelProductBrandCoverage), _GetProductBrandCoverageAsync);


as a result, all the requests were sent before any results coming
back.
My question is, when a result indicating error comes back, how can I
ignore further return? or how can I kill these delegates?
I tried to have a bool value and just return when it set to true.
However, the web page still keeps on loading until all the
asynchronoused calls finished.

So what are my options?

Many Thanks

Jerry
 
B

bruce barker

keep a list of the webservice proxies you are calling. as soon as one fails,
loop thru the list and call the Abort method. this will cause the complete
routines to called with an error.

-- bruce (sqlwork.com)
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top