public static DeliveryPoints GetDeliveryPoints(DateTime startDate, DateTime lastUpated) { //Get delivery points DeliveryPoints points = null; try { _Client = new DeliveryPointsServiceClient(); points = _Client.GetDeliveryPoints(startDate, lastUpated); _Client.Close(); } catch (FaultException fe) { throw new ApplicationException("GetDeliveryPoints() service error.", fe); } catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetDeliveryPoints() timeout error.", te); } catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetDeliveryPoints() communication error.", ce); } return(points); }
public static DeliveryPointsDataset GetDeliveryPoints(DateTime startDate, DateTime lastUpated) { //Get delivery points DeliveryPointsDataset points = new DeliveryPointsDataset(); DeliveryPointsServiceClient client = new DeliveryPointsServiceClient(); try { DataSet ds = client.GetDeliveryPoints(startDate, lastUpated); if (ds != null) { points.Merge(ds); } client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <TerminalsFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(points); }