アプリケーションが開始されると、DispatcherTimer が実行されます。10 秒ごとに running() 関数が実行され、running() 関数は Web サービスを消費し、非常にうまく動作します。システムが Web サービスを取得できない場合、「System.timeOut 例外」が発生します。例外を解決するには?
あなたが提供できる助けをありがとう!
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);
...
}
reference.cs で
public string EndReadTotalOutstandingInvoice(System.IAsyncResult result) {
object[] _args = new object[0];
string _result = ((string)(base.EndInvoke("ReadTotalOutstandingInvoice", _args, result)));
return _result;
}