IT分销/经销工作流集成

工作流如何调用rest服务?

参与2

1同行回答

匿名用户匿名用户
(1)通过配置应用程序调用rest服务 年编写java类型的应用程序,在java程序中调用rest服务 (2)以web服务的形式调用rest服务 此种方式对rest服务的声明有一定要求,声明方式如下所示,仅供参考: @Mapping("/rest/getUserInfo") public Renderer cnkeet() throws Exception { ActionCon...显示全部

(1)通过配置应用程序调用rest服务 年编写java类型的应用程序,在java程序中调用rest服务 (2)以web服务的形式调用rest服务 此种方式对rest服务的声明有一定要求,声明方式如下所示,仅供参考: @Mapping("/rest/getUserInfo") public Renderer cnkeet() throws Exception { ActionContext ac=ActionContext.getActionContext(); HttpServletRequesthrq=ac.getHttpServletRequest();Stringid=hrq.getParameter(“id”); JSONObject object=new JSONObject(); object.put(“id”, id); return new PlainRenderer(object.toString()); } 此种声明方式需要通过request获取参数值】 注:如果rest服务声明为如下形式 @Mapping("/rest/getUserInfo/$1/$2") public Renderer getUserInfo(String id) throws Exception { } 工作流在调用rest服务时,url为http://ip:port/context/rest/getUserInfo?t=""&n="" 。与rest声明不符,调用失败, 导致调用rest服务失败。

收起
IT分销/经销 · 2019-06-01
浏览465

问题状态

  • 发布时间:2019-06-01
  • 关注会员:1 人
  • 问题浏览:812
  • 最近回答:2019-06-01
  • X社区推广