Пример #1
0
        //Interface
        static FreightGateway()
        {
            //
            LTLService2Client client = new LTLService2Client();

            _state   = true;
            _address = client.Endpoint.Address.Uri.AbsoluteUri;
        }
Пример #2
0
        public ServiceInfo GetServiceInfo()
        {
            //Get the operating enterprise terminal
            LTLService2Client client = new LTLService2Client();

            try {
                return(client.GetServiceInfo());
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
        }
Пример #3
0
        public static void WriteLogEntry(TraceMessage m)
        {
            //Get the operating enterprise terminal
            LTLService2Client client = null;

            try {
                client = new LTLService2Client();
                client.WriteLogEntry(m);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); }
        }
Пример #4
0
        public UserConfiguration GetUserConfiguration(string application, string[] usernames)
        {
            //Get the application configuration for the specified user
            UserConfiguration config = null;
            LTLService2Client client = new LTLService2Client();

            try {
                config = client.GetUserConfiguration(application, usernames);
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(config);
        }
Пример #5
0
        public static ServiceInfo GetServiceInfo()
        {
            //Get the operating enterprise terminal
            ServiceInfo       terminal = null;
            LTLService2Client client   = null;

            try {
                client   = new LTLService2Client();
                terminal = client.GetServiceInfo();
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); }
            return(terminal);
        }
Пример #6
0
        public static UserConfiguration GetUserConfiguration(string application, string[] usernames)
        {
            //Get the operating enterprise terminal
            UserConfiguration config = null;
            LTLService2Client client = null;

            try {
                client = new LTLService2Client();
                config = client.GetUserConfiguration(application, usernames);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); }
            return(config);
        }
Пример #7
0
        public void WriteLogEntry(LogLevel level, string username, Exception ex)
        {
            //Write an entry into the Argix log
            LTLService2Client client = new LTLService2Client();

            try {
                TraceMessage tm = new TraceMessage();
                tm.Name     = LOG_NAME;
                tm.LogLevel = level;
                tm.Date     = DateTime.Now;
                tm.Source   = LOG_SOURCE;
                tm.Category = tm.Event = "";
                tm.User     = username;
                tm.Computer = "";
                tm.Keyword1 = tm.Keyword2 = tm.Keyword3 = "";
                tm.Message  = ex.ToString();
                client.WriteLogEntry(tm);
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
        }