如何将xpath中的字符串放入enricher url

如何将xpath中的字符串放入enricher url,xpath,apache-camel,Xpath,Apache Camel,我需要一个Enricher的GET参数。我想从xpath消息体中获取这个参数。但它不想工作。我错了什么 .enrich("localhost/getArticle.php?ArticleNumber="+xpath("//POSITION/ARTICLENUMMER[@TYPE='IN']/text()"), new addArticleStrategy()) 但被调用的URL是: http://localhost/getArticle.php?ArticleNumber=XPath%3A+%

我需要一个Enricher的GET参数。我想从xpath消息体中获取这个参数。但它不想工作。我错了什么

.enrich("localhost/getArticle.php?ArticleNumber="+xpath("//POSITION/ARTICLENUMMER[@TYPE='IN']/text()"), new addArticleStrategy())
但被调用的URL是:

http://localhost/getArticle.php?ArticleNumber=XPath%3A+%2F%2FPOSITION%2FARTICLENUMMER%5B%40TYPE%3D%27IN%27%5D%2Ftext%28%29
如何从xpath而不是xpath字符串中获取值

多谢各位

更新:

全程:

from("activemq:in")
.enrich("localhost/getArticle.php?ArticleNumber="+xpath("//POSITION/ARTICLENUMMER[@TYPE='IN']/text()"), new addArticleStrategy())
.to("file://C:/temp/")
更新2: 我尝试使用以下方法:

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

您不能将动态URL与enrich一起使用。试着改用

编辑:

我还没有试过(很抱歉,可能是打字错误),但它应该是这样的

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}"));

你能帮我怎么做吗?RecipientList(“localhost/getArticle.php?ArticleNumber=“+xpath(“//POSITION/ARTICLENUMMER[@TYPE='IN']/text()”)).enrich(new addArticleStrategy())不起作用发布完整路线请在我的问题中查看更新抱歉,这不起作用。我没有从AggregationStrategy中的请求中获得结果。有一个空的身体。URL构建工作现在开始!!!!