Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Multi-threaded web service client

1 view
Skip to first unread message

chendricks

unread,
Oct 2, 2007, 10:21:01 AM10/2/07
to
I have a C# winform client application that interacts with a library of web
services running on a single web site. The application makes multiple web
service calls in multiple background threads to avoid locking up the UI while
web service calls are processed. Some of these web service calls may be
concurrent.

Every now and then the client will lockup and becomes completely
unresponsive to the user. No exception is thrown. All the threads just stop.
I have already made sure that none of the background threads call a UI
control without using the Invoke method.

Is it safe to make multiple web service calls from multiple threads within a
single client application to a single web services server? Any suggestions on
what I'm doing wrong?

Thanks for any help,

Colin

Andrew Brook

unread,
Oct 2, 2007, 10:28:28 AM10/2/07
to
Hi Colin,

Perhaps it would make the coding easier if you were to call the Async
versions of the web methods and pass in a callback function. At least that
way you wouldn't need to handle creating your own threads, and possibly
avoid further related troubles.

just a thought :)

Andrew

"chendricks" <chend...@discussions.microsoft.com> wrote in message
news:9A7BCAFE-CF86-4286...@microsoft.com...

chendricks

unread,
Oct 2, 2007, 10:37:01 AM10/2/07
to
Yes, I've considered that and perhaps I'll try it. How are timeouts handled
under the async model in cases where the network is not available?

Andrew Brook

unread,
Oct 2, 2007, 10:52:31 AM10/2/07
to
that's a good question - but i'm afraid I don't know the answer. You'd
expect an exception somewhere, but where it would surface I've got no idea.
I suppose it would be easy enough to test though.

Sorry!
Andrew

"chendricks" <chend...@discussions.microsoft.com> wrote in message

news:3470A877-8B36-4AE0...@microsoft.com...

Andrian

unread,
Oct 7, 2007, 8:48:08 AM10/7/07
to
Colin,

When using asynchornous BeginMethod, any exception from that method will be
thrown when u call end EndMethod to complete the function call (if you
will). So the following code will give u an idea:

Proxy.BeginCall(new AsyncCallback(...));

void CallEnded(IAsyncResult state) // the callback function passed to the
BeginCall function
{
try
{
Proxy.EndCall(state);
}
}

the parameters or type of parameter passed to the functions may not be
compleely accurate, but its only an illustration.

--
Andrian
"Andrew Brook" <yko...@hotmail.com> wrote in message
news:%23HExSPQ...@TK2MSFTNGP05.phx.gbl...

0 new messages