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 9E9469BF2 for ; Wed, 28 Dec 2011 09:36:55 +0000 (UTC) Received: (qmail 15508 invoked by uid 500); 28 Dec 2011 09:36:55 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 15479 invoked by uid 500); 28 Dec 2011 09:36:55 -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 15470 invoked by uid 99); 28 Dec 2011 09:36:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Dec 2011 09:36:55 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of willem.jiang@gmail.com designates 209.85.210.173 as permitted sender) Received: from [209.85.210.173] (HELO mail-iy0-f173.google.com) (209.85.210.173) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Dec 2011 09:36:49 +0000 Received: by iagj37 with SMTP id j37so25240203iag.32 for ; Wed, 28 Dec 2011 01:36:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=uiHGn4gSx3bOUTYQJ0XQxWCdr0iO+zkCDpSR3uNotsM=; b=N4ufrzfVyc7JCX3e1BsnMVsC0ZYHJNk6wKBw7xHM0SrOx38RM49xuB3qzi6USsb63B U9oFZOiEAgW01x1XDvWLDflnzfwF70vewmGVxRqLk80ir6sg8qS8I9lxMI56KCAzd5Sb Oz716HQ+OKblFXop9IQBE2vNVkepmvkjb9QZE= Received: by 10.50.51.199 with SMTP id m7mr35437705igo.23.1325064989190; Wed, 28 Dec 2011 01:36:29 -0800 (PST) Received: from [192.168.0.158] ([125.33.122.255]) by mx.google.com with ESMTPS id rc7sm71899726igb.0.2011.12.28.01.36.25 (version=SSLv3 cipher=OTHER); Wed, 28 Dec 2011 01:36:28 -0800 (PST) Message-ID: <4EFAE316.4030206@gmail.com> Date: Wed, 28 Dec 2011 17:36:22 +0800 From: Willem Jiang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: users@camel.apache.org Subject: Re: Camel CXFRS and multiple @QueryParam arguments References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Matt, The MessageContentsList is use the same parameter order as the method argument, I think you can count on it. You can inspect the CamelHttpQuery header at the same time to verify my suggestion, I don't think camel-cxfrs support the passer it as Map out of the box. On Tue Dec 27 22:52:17 2011, Matt Narrell wrote: > Hello all, > > Suppose I have a method to expose via REST: > > @GET > @Path("/doSomething") > public Response doSomething(@QueryParam("foo") String foo, @QueryParam("bar") String bar) {..} > > Then wired in Spring XML as: > > > > Then added to a route as: > > from("cxfrs:bean:someBean").process(..) > > =========================================== > > When I reach the processor, the exchange body is a MessageContentsList containing the values passed for "foo" and "bar". Is there a way to retrieve these query params via their annotated names, either by some TypeConverter or header property? I'm not guaranteed that the callers will pass these parameters ordered as they are in the method signature, so iterating over the MessageContentsList is tricky if the params are of the same type, or if not all the parameters were provided. > > Alternatively, I could inspect the CamelHttpQuery header in my processor and construct a Map, but I'm curious if there's configuration, TypeConverters, or other ways to achieve this, out-of-the-box. > > Thanks, > Matt -- Willem ---------------------------------- FuseSource Web: http://www.fusesource.com Blog: http://willemjiang.blogspot.com (English) http://jnn.javaeye.com (Chinese) Twitter: willemjiang Weibo: willemjiang