Hi Ralf,

I think you use misused the cxfbean component.
cxfbean component is trying to leverage the camel components to provides 
different transports.

It will marshal and unmarshal the request and response out of box.

What's you need is camel-cxfrs[1] component, you should be able to get the Java 
object of PriceReuqestMessage from the message body.

[1]http://camel.apache.org/cxfrs.html 

-- 
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang 
Weibo: willemjiang



On Friday, September 7, 2012 at 10:35 PM, Ralf Steppacher wrote:

> Hello all,
> 
> a quick question about using RESTful endpoints:
> Given the route and resource definition below, I end up with the JSON
> representation of the PriceRequestMessage in the exchange body, not the
> Java object of type PriceRequestMessage. Is there a way to keep the
> object as it was created by the nameValueProvider and passed into
> getIndicativePrice(PRM prm) in the exchange body and only marshal the
> object to the format requested by the client at the very end of the
> route?
> 
> @POST
> @Path("/price")
> @Consumes("application/x-www-form-urlencoded")
> @Produces("application/json")
> public PriceRequestMessage getIndicativePrice(PriceRequestMessage prm) {
> return prm;
> }
> 
> <camel:route id="rest.route.request.price">
> <camel:from ref="jettyEndpoint" />
> <camel:to
> uri="cxfbean:pricingResource?providers=#jsonJacksonProvider,#nameValueProvider"
>  />
> <camel:enrich ref="mq.queue.pricerequest" />
> </camel:route>
> 
> 
> Thanks!
> Ralf



Reply via email to