作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要一个到Enricher的GET参数。我想从带有xpath的消息正文中获取此参数。但是它不想工作。我怎么了
.enrich("localhost/getArticle.php?ArticleNumber="+xpath("//POSITION/ARTICLENUMMER[@TYPE='IN']/text()"), new addArticleStrategy())
http://localhost/getArticle.php?ArticleNumber=XPath%3A+%2F%2FPOSITION%2FARTICLENUMMER%5B%40TYPE%3D%27IN%27%5D%2Ftext%28%29
from("activemq:in")
.enrich("localhost/getArticle.php?ArticleNumber="+xpath("//POSITION/ARTICLENUMMER[@TYPE='IN']/text()"), new addArticleStrategy())
.to("file://C:/temp/")
from("activemq:in")
.enrich("localhost/getArticle.php?ArticleNumber="+xpath("//POSITION/ARTICLENUMMER[@TYPE='IN']/text()").evaluate(getContext(), body().convertToString()), new addArticleStrategy())
.to("file://C:/temp/")
No type converter available to convert from type: org.apache.camel.builder.ValueBuilder to the required type: org.w3c.dom.Document with value body
最佳答案
您不能将动态网址与扩展一起使用。尝试改用recipientList
编辑:
我没有尝试过(很可能打错了),但它看起来应该像这样
XPathBuilder articlexpath=xpath("//POSITION/ARTICLENUMMER[@TYPE='IN']/text()").resultType(String.class);
from("activemq:in")
.enrich("direct:getArticle", new addArticleStrategy())
.to("file://C:/temp/");
from("direct:getArticle")
.setHeader("ArticleNumber", articlexpath)
.recipientList(simple("localhost/getArticle.php?ArticleNumber=${header.ArticleNumber}"));
关于xpath - 我如何将字符串从xpath放入richler URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28043060/
我是一名优秀的程序员,十分优秀!