public void ResponseOriginal() { var ws = new RunEngine(); _response = ws.SearchCust(new AppHeader(), _request) as SearchResponse; _response2 = ws.CancelCust(new AppHeader(), _request2) as CancelResponse; }
public void Response() /* tried to correct */ { var ws = new RunEngine(); _response = ws.SearchCust(new AppHeader(), _request) as SearchResponse; var customerIds = _response.Customers.Select(c => c.CustID).ToList(); foreach (var custID in customerIds) { _request2 = new CancelRequest(); _request2.CustID = custID; _request2.Company = _request.Company; // Seems it should be like this _response2 = ws.CancelCust(new AppHeader(), _request2) as CancelResponse; } }
public void Response() /* tried to correct */ { var ws = new RunEngine(); _response = ws.SearchCust(new AppHeader(), _request) as SearchResponse; var customerIds = _response.Customers.Select(c => c.CustID).ToList(); foreach (var custID in customerIds) { _request2 = new CancelRequest(); _request2.CustID = custID; _request2.Company = _request.Company; // Seems it should be like this // but note the assignment might be wrong, it's according to what `CancelCust` returns // for the correct way to make it a list of Customer is appeared in other answers _response2 = ws.CancelCust(new AppHeader(), _request2) as CancelResponse; } }