Exemple #1
0
 /**
  * dubbo方式调用服务
  *
  * @author 黄永丰
  * @createtime 2016年2月1日
  * @param serviceName 服务名称
  * @param interfaceName 接口名称
  * @param data 传入数据
  * @return 调用完接口数据String
  */
 public static String dubbo(String serviceName, String interfaceName, String data) {
   ApplicationContext ctx = GlobalContainer.getApplicationContext();
   ApiInterface service = (ApiInterface) ctx.getBean(serviceName);
   JSONObject obj = new JSONObject();
   obj.put("interfaceName", interfaceName);
   obj.put("data", data);
   String result = service.doPost(obj.toString());
   return result;
 }