Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E83187419 for ; Tue, 23 Aug 2011 10:03:03 +0000 (UTC) Received: (qmail 82334 invoked by uid 500); 23 Aug 2011 10:03:01 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 81836 invoked by uid 500); 23 Aug 2011 10:02:48 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 81827 invoked by uid 99); 23 Aug 2011 10:02:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Aug 2011 10:02:42 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of freeman.fang@gmail.com designates 209.85.210.43 as permitted sender) Received: from [209.85.210.43] (HELO mail-pz0-f43.google.com) (209.85.210.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Aug 2011 10:02:36 +0000 Received: by pzk1 with SMTP id 1so14894281pzk.30 for ; Tue, 23 Aug 2011 03:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; bh=nk3xZGahgztKAkT113+sCC3b4SNeSZ/MFmMRt9atCuw=; b=kpfiGRZEcGU07tT4G+teD3agvMOFRinRBnkznnAovnzVd2ybqSeqSse33LbA+VgV1Q SjOfwvj6pEbeLE3rrsbhphnYK71oDOeZ4m4oV2Pl/p/aNl1vFI4iGu25906eYgPu1/x2 YllbGlJAtutB5P2dGDrI2gyxWsfkml6oHf9DY= Received: by 10.143.60.19 with SMTP id n19mr1951780wfk.241.1314093736325; Tue, 23 Aug 2011 03:02:16 -0700 (PDT) Received: from [192.168.1.101] ([123.116.131.216]) by mx.google.com with ESMTPS id g4sm118045pbj.41.2011.08.23.03.02.12 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Aug 2011 03:02:15 -0700 (PDT) Message-Id: From: Freeman Fang To: users@camel.apache.org In-Reply-To: <1314092615874-4726154.post@n5.nabble.com> Content-Type: multipart/alternative; boundary=Apple-Mail-5-779079863 Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: setHeader using xpath returns Object? Date: Tue, 23 Aug 2011 18:02:08 +0800 References: <1314092615874-4726154.post@n5.nabble.com> X-Mailer: Apple Mail (2.936) --Apple-Mail-5-779079863 Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Hi, It should be setHeader("incomingDate", xpath("//incoming:Value[1]/@date", =20 String.class, ns)) but not setHeader("incomingDate") .xpath("//incoming:Value[1]/@date", String.class, ns) Freeman On 2011-8-23, at =E4=B8=8B=E5=8D=885:43, heinrichheine wrote: > Hi, > > i'm building my first route using the java DSL and i'm running in a =20= > small > trouble setting a header field. > > I had a spring route looking and working like this: > > > resultType=3D"java.lang.String">//incoming:Value[1]/@date > > > 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 =20 > 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-tp4= 726154p4726154.html > Sent from the Camel - Users mailing list archive at Nabble.com. --------------------------------------------- Freeman Fang FuseSource Email:ffang@fusesource.com Web: fusesource.com Twitter: freemanfang Blog: http://freemanfang.blogspot.com --Apple-Mail-5-779079863--