예제 #1
0
파일: EsbClient.cs 프로젝트: BiYiTuan/soa
        /// <summary>
        /// 根据服务请求获取到对应的URL绑定信息
        /// </summary>
        /// <param name="serviceName"></param>
        /// <returns></returns>
        private static EntityList <BindingTemplate> GetBindings(ESB.Core.Schema.务请求 request)
        {
            String          serviceName = request.务名称;
            BusinessService service     = BusinessService.FindByServiceName(serviceName);

            if (service == null)
            {
                throw LogUtil.ExceptionAndLog(String.Format("服务【{0}】尚未注册!", serviceName), "", request);
            }


            //--查找某个服务下所有启用状态的绑定
            EntityList <BindingTemplate> bings = BindingTemplate.FindAllByServiceID(service.ServiceID);

            if (bings == null || bings.Count == 0)
            {
                throw LogUtil.ExceptionAndLog(String.Format("服务【{0}】尚未绑定任何路由地址!", serviceName), "", request);
            }

            return(bings);
        }
예제 #2
0
 public List <BindingTemplate> GetBindingByServiceID(String serviceID)
 {
     return(BindingTemplate.FindAllByServiceID(serviceID));
 }