C# client program gets timeout when calling web service

J

jasonofford

I have a C# program that makes a simple call to a web service. The web
service gathers data from a database and send it back to my program as
a DataSet.
- After opening the program and initiating the first method call to the
web service, I get back the data set perfectly, and am able to put it
in a data grid to display.
- The second time I call the same method, it "sometimes" gives me data
back, and sometimes I get a timeout exception.
- The third time always times out.

Overview of the code:

Button_Click_Method
try
create object reference to the web service
set the URL to the desired web service location (from a text
field)
execute a method from the web service depending on what the
user selects from a drop down
display the data set in a data grid
catch
display message box with exception message

Any help would be greatly appreciated.
 
C

Catalin T

You could set the Timeout property to increase the time your client will wait
but I think you need to optimize the SQL query and bring the execution time
down. If you can't use async calls to your WS so that you don't block the
client app for a long time.

Regards,
Catalin
 

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,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top