Esempio n. 1
0
        public static void GetSapInfo(object source, ElapsedEventArgs e)
        {
            LogService.LogInfo("开始获取SAP信息 ...");
            ServerObjFactory serverFactory = new ServerObjFactory();
            ISAPEngine       engine        = serverFactory.CreateISAPEngine();

            engine.RefreshSAPWorkOrderInfo();
            LogService.LogInfo("结束SAP信息的操作 ...");
        }
Esempio n. 2
0
        /// <summary>
        /// 注册远程对象——客户端可调用的对象
        /// </summary>
        /// <returns>bool</returns>
        public static bool RegisterRemoteObject()
        {
            try
            {
                if (RemotingConfiguration.CustomErrorsMode != CustomErrorsModes.Off)
                {
                    RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;
                }
                //RemotingHelper.RegisterRemoteObjectViaXmlConfig();
                f = new ServerObjFactory();
                //序列化f对象
                RemotingServices.Marshal(f, typeof(IServerObjFactory).FullName);
                n = new Notifier();
                //序列号n对象
                RemotingServices.Marshal(n, typeof(INotifier).FullName);
                return(true);
            }
            catch (Exception ex)
            {
                LogService.LogError("Register remoting server object exception : " + ex.ToString());
            }

            return(false);
        }