public static DarwinDepartureBoard GetGetEntireBoard(string crs, int offset, int window) { try { LDBServiceSoapClient client = new LDBServiceSoapClient(); StationBoardWithDetails board = null; using (OperationContextScope scope = new OperationContextScope(client.InnerChannel)) { MessageHeader authHeader = MessageHeader.CreateHeader("AccessToken", @"http://thalesgroup.com/RTTI/2013-11-28/Token/types", DarwinToken.TheAccessToken); OperationContext.Current.OutgoingMessageHeaders.Add(authHeader); //Note that this is called on a background thread - I don't need to make it async. Doing so causes a range of exciting race hazards further on GetDepBoardWithDetailsResponse response = client.GetDepBoardWithDetailsAsync(0, crs, string.Empty, FilterType.from, offset, window).Result; board = (StationBoardWithDetails)response.GetStationBoardResult; } return(DarwinDepartureBoardFactory.CreateDepartureBoard(board)); } catch (AggregateException ae) { crashDump(ae); return(null); } catch (System.Runtime.InteropServices.SEHException seh) { crashDump(seh); return(null); } }
public async Task <GetDepBoardWithDetailsResponse> GetDepBoardWithDetailsAsync(AccessToken accessToken, ushort numRows, string crs, string filterCrs, FilterType filterType, int timeOffset, int timeWindow) { return(await Execute(() => client.GetDepBoardWithDetailsAsync(accessToken, numRows, crs, filterCrs, filterType, timeOffset, timeWindow))); }