camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Camel CXFRS and multiple @QueryParam arguments
Date Wed, 28 Dec 2011 09:36:22 GMT
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:
>
> 	<camelCxf:rsServer id="someBean" address="/somePath" serviceClass="org.some.package.SomeService"/>
>
> 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 


Mime
View raw message