コード例 #1
0
        public static TemplateDataset GetShippersAndTerminals()
        {
            //Get terminals list
            TemplateDataset terminals = new TemplateDataset();
            ShipScheduleTemplatesServiceClient client = new ShipScheduleTemplatesServiceClient();

            try {
                DataSet ds = client.GetShippersAndTerminals();
                if (ds != null)
                {
                    terminals.Merge(ds);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ShipScheduleFault> efe) { client.Abort(); throw new ApplicationException(efe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(terminals);
        }