我正在尝试在 Windows 8 中使用 wcf:我的代码使用 WCF 服务生成的方法:
public System.Threading.Tasks.Task<Maquette_MyAirport_Win8.FlightService.CitiesResponse>
GetAllCitiesAsync(Maquette_MyAirport_Win8.FlightService.BaseRequest request)
{
return base.Channel.GetAllCitiesAsync(request);
}
是
public testproxy()
{
_client = new FlightInfoServiceClient(Maquette_MyAirport_Win8.FlightService.FlightInfoServiceClient.EndpointConfiguration.wsHttpBindingConfiguration);
BaseRequest req = new BaseRequest();
System.Threading.Tasks.Task<Maquette_MyAirport_Win8.FlightService.CitiesResponse> CitiesResponse = _client.GetAllCitiesAsync( new BaseRequest());
CitiesResponse.ContinueWith(task => citiesL = task.Result.Cities.FirstOrDefault(););
}
任务 cityResponse 的状态是“WaitingForACtivation”和 Result="Not yet Computed"
如何激活任务以及如何获得结果?