Ejemplo n.º 1
0
        public static void InitMesMessage(bool IsDB01)
        {
            try
            {
                _MessageExchangeServiceClient = new MessageExchangeServiceClient("NetTcpBinding_IMessageExchangeService");
                EAPOutput output;

                QueryStripInfo lotQueryInput = new QueryStripInfo();

                EAPInput input = new EAPInput();


                output = _MessageExchangeServiceClient.EAPRequest(input);
            }
            catch (Exception e)
            {
                e.Message.ToString();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// DB01->true;DB02->false
        /// </summary>
        /// <param name="IsDB01"></param>
        public static void InitMesMessage(bool IsDB01)
        {
            try
            {
                if (IsDB01)
                {
                    //var  binding=new NetTcpBinding();
                    // binding.OpenTimeout=new TimeSpan(0,0,15);
                    // binding.CloseTimeout=new TimeSpan(0,0,15);
                    //  binding.ReceiveTimeout=new TimeSpan(0,0,15);
                    //  binding.OpenTimeout=new TimeSpan(0,0,15);
                    // binding.TransactionFlow=false;
                    // binding.TransferMode=TransferMode.Streamed;

                    //binding.ReaderQuotas =new XmlDictionaryReaderQuotas();
                    // binding.ReaderQuotas.MaxDepth=536870912;
                    // binding.ReaderQuotas.MaxStringContentLength=2147483647 ;
                    // binding.ReaderQuotas.MaxArrayLength=2147483647 ;
                    // binding.ReaderQuotas.MaxBytesPerRead=536870912 ;
                    // binding.ReaderQuotas.MaxNameTableCharCount=2147483647;
                    // binding.ReliableSession=new OptionalReliableSession();
                    // binding.ReliableSession.Enabled=false;
                    // binding.Security=new NetTcpSecurity();
                    // binding.Security.Mode=SecurityMode.None;


                    _MessageExchangeServiceClient = new MessageExchangeServiceClient(EndpointConfigurationNameForDB);
                    //  _MessageExchangeServiceClient = new MessageExchangeServiceClient(binding, new EndpointAddress(@"net.tcp://10.65.4.118:8899/MessageExchangeCenter/MessageExchangeService"));
                }
                else
                {
                    _MessageExchangeServiceClient = new MessageExchangeServiceClient(EndpointConfigurationNameForWB);
                }
            }
            catch (Exception e)
            {
                //LogShown.RecordLog(string.Format("连接MES服务器初始化异常;{0}",e), LogLevel.Warn);
            }
        }