likewer
likewer

Reputation: 216

An unhandled exception of type "System.timeOut exception"

When the application started, it will run the DispatcherTimer. Every 10 second, it will run the function of running() and the function running() is consume a webservice and it run very well. When the system can not get the webservice, it pop out the "System.timeOut exception". How to solve the exception?

Thank for any help You can provided!

private void running()
    {    
         ServiceReference1.WebServiceSoapClient test = new ServiceReference1.WebServiceSoapClient();

         test.ReadTotalOutstandingInvoiceCompleted += new EventHandler<ServiceReference1.ReadTotalOutstandingInvoiceCompletedEventArgs>(serviceClient);  

         test.ReadTotalOutstandingInvoiceAsync();
    }

private void serviceClient(object sender, ReadTotalOutstandingInvoiceCompletedEventArgs e)

    {
         tbTesting.Text = e.Result.ToString();

         tbTextbox2.Text = "You have " + tbTesting.Text + " Invoice !!";
         ...
         MessageBox.Show("You have " + tbTesting.Text + " new Invoice" +Environment.NewLine+ Environment.NewLine+ DateTime.Now, "Invoice", MessageBoxButton.OK);
         ...
        }

In the reference.cs

public string EndReadTotalOutstandingInvoice(System.IAsyncResult result) {

        object[] _args = new object[0];
        string _result = ((string)(base.EndInvoke("ReadTotalOutstandingInvoice", _args, result)));
        return _result;
    }

Upvotes: 1

Views: 2001

Answers (1)

user2038443
user2038443

Reputation: 163

this is simply telling you that whatever the webservice is doing has timed out and is probably unavailable. Also hard to tell what you mean by "solve the exception", if the webservice is unavailable there is probably nothing you can do about it.

Upvotes: 1

Related Questions