Beispiel #1
0
        public bool LoadAsrsExtSvc()
        {
            try
            {
                //杭可分容服务部署
                // hkFenrongSvc = new HkFenrongSvc(this.asrsResManage);
                Uri                        _baseAddress = new Uri("http://localhost:8999/JCJ/AoyouFenrongSvc/");
                EndpointAddress            _Address     = new EndpointAddress(_baseAddress);
                BasicHttpBinding           _Binding     = new BasicHttpBinding();
                ContractDescription        _Contract    = ContractDescription.GetContract(typeof(AsrsExtctlSvc.Interface.IHangkeFenrong));
                ServiceEndpoint            endpoint     = new ServiceEndpoint(_Contract, _Binding, _Address);
                AsrsExtctlSvc.HkFenrongSvc hkFenrongSvc = new AsrsExtctlSvc.HkFenrongSvc(this.asrsResManage, "B1库房");
                hkFenrongSvc.logRecorder = logRecorder;
                hkFenrongSvc.AsrsCtl     = asrsPresenter.GetAsrsCtlByName("B1库房");
                //添加终结点ABC
                ServiceHost host = new ServiceHost(hkFenrongSvc, _baseAddress);
                host.Description.Endpoints.Add(endpoint);
                //启用元数据交换
                ServiceMetadataBehavior meta = new ServiceMetadataBehavior();

                meta.HttpGetEnabled = true;
                host.Description.Behaviors.Add(meta);
                host.Open();
                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine("部署分容服务失败:" + ex.ToString());
                return(false);
            }
        }
Beispiel #2
0
        public bool GetAsrsStat(string asrsHoseName, ref int errCode, ref string[] status)
        {
            AsrsCtlModel asrsCtl = asrsPresenter.GetAsrsCtlByName(asrsHoseName);

            if (asrsCtl == null)
            {
                return(false);
            }
            return(asrsCtl.StackDevice.GetRunningStatus(ref errCode, ref status));
        }