C# client program gets timeout when calling web service

Discussion in 'ASP .Net Web Services' started by jasonofford@gmail.com, Nov 29, 2006.

  1. Guest

    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.
     
    , Nov 29, 2006
    #1
    1. Advertising

  2. Catalin T Guest

    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



    "" wrote:

    > 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.
    >
    >
     
    Catalin T, Dec 7, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    456
  2. Replies:
    1
    Views:
    6,312
  3. Ale
    Replies:
    7
    Views:
    2,492
    Mike Schilling
    Dec 29, 2010
  4. Mark Probert

    Timeout::timeout and Socket timeout

    Mark Probert, Oct 6, 2004, in forum: Ruby
    Replies:
    1
    Views:
    1,310
    Brian Candler
    Oct 6, 2004
  5. Replies:
    0
    Views:
    170
Loading...

Share This Page