Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / October 2007

Tip: Looking for answers? Try searching our database.

Multi-threaded web service client

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
chendricks - 02 Oct 2007 15:21 GMT
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 - 02 Oct 2007 15:28 GMT
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

>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
[quoted text clipped - 18 lines]
>
> Colin
chendricks - 02 Oct 2007 15:37 GMT
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?

> Hi Colin,
>
[quoted text clipped - 29 lines]
> >
> > Colin
Andrew Brook - 02 Oct 2007 15:52 GMT
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

> Yes, I've considered that and perhaps I'll try it. How are timeouts
> handled
[quoted text clipped - 38 lines]
>> >
>> > Colin
Andrian - 07 Oct 2007 13:48 GMT
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.

Signature

Andrian

> 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
[quoted text clipped - 47 lines]
>>> >
>>> > Colin

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.