/// <summary> /// 创建服务对象 /// </summary> /// <returns></returns> private void CreateService() { //本地调用 if (IsLocalCall()) { Type serviceType = CreateServiceType(); if (serviceType == null) { throw new System.Exception("接口契约ServiceInfo属性值配置错误!"); } _Service = (T)TypeHelper.CreateObject(serviceType, typeof(T), true, null); } else { serviceAgent = new ServiceAgent <T>(); _Service = serviceAgent.Service; } }