private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { if (backgroundWorker1.CancellationPending) { e.Cancel = true; return; } try { _client = new WebService1SoapClient(); var call = CallServerAsync("ServerName", "ActionName"); call.Wait(_cancellationTokenSource.Token); e.Result = call.Result; } catch (TaskCanceledException) { e.Cancel = true; _client.Abort(); } }