Hi,
It should be
setHeader("incomingDate", xpath("//incoming:Value[1]/@date",
String.class, ns))
but not
setHeader("incomingDate")
.xpath("//incoming:Value[1]/@date", String.class, ns)
Freeman
On 2011-8-23, at 下午5:43, heinrichheine wrote:
Hi,
i'm building my first route using the java DSL and i'm running in a
small
trouble setting a header field.
I had a spring route looking and working like this:
<camel:setHeader headerName="incomingDate">
<camel:xpath
resultType="java.lang.String">//incoming:Value[1]/@date</camel:xpath>
</camel:setHeader>
I want to build exactly the same in the java dsl:
.setHeader("incomingDate")
.xpath("//incoming:Value[1]/@date", String.class, ns)
The problem is, that xpath returns an Object, so i cannot continue
configuring my route from this point.
I want to put a choice as next step in the route, but thats not
working
because xpath returns an Object.
And also i get a compiler warning due to type safety.
Does anyone have an idea for this?
Thanks in advance
martin
--
View this message in context:
http://camel.465427.n5.nabble.com/setHeader-using-xpath-returns-Object-tp4726154p4726154.html
Sent from the Camel - Users mailing list archive at Nabble.com.
---------------------------------------------
Freeman Fang
FuseSource
Email:ff...@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com