On Tue, Aug 23, 2011 at 11:43 AM, heinrichheine
<[email protected]> 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.
But the xpath inside as a parameter to .setHeader
.setHeader("incomingDate", xpath("//incoming:Value[1]/@date",
String.class, ns))
> 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.
>
--
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/