Hi On 07/09/12 15:35, 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>
Can you do camel:enrich progarammatically, within getIndicativePrice(PriceRequestMessage prm) ?
Cheers, Sergey
Thanks! Ralf
-- Sergey Beryozkin Talend Community Coders http://coders.talend.com/ Blog: http://sberyozkin.blogspot.com
