我试图建立连接REST端点与Apache骆驼。 我已经有一个REST服务返回JSON我的内容,我想这个端点得到它。 我的问题是,我不知道发生了什么,当我的骆驼途径是建立..目前,它不会做任何事情。 这里是我的代码:
restConfiguration().component("servlet")
.bindingMode(RestBindingMode.json)
.dataFormatProperty("prettyPrint", "true").host("localhost")
.port(9080);
rest("/ContextServices/rest/contextServices/document")
.consumes("application/json").produces("application/json")
.get("/testContext/557064c8f7f71f29cea0e657").outTypeList(String.class)
.to("bean:processor?method=affiche")
.to(dest.getRouteTo());
我在端口上运行我的REST服务上的本地Tomcat的9080
,我的完整URL是
/ ContextServices / REST / contextServices /文件/ {收集} / {ID}。
我试图读取文档,但在两个语法和两个不工作:
from("rest:get:hello:/french/{me}").transform().simple("Bonjour ${header.me}");
要么
rest("/say")
.get("/hello").to("direct:hello")
.get("/bye").consumes("application/json").to("direct:bye")
.post("/bye").to("mock:update");
首先是Java的DSL,第二个是REST DSL,有什么区别?
非常感谢 !