It could be more easy if we just use the SimpleConsumer binding which can let 
us deal with REST message in a simple generic way in Camel route. Please check 
out Simple Binding Style[1] page for more information.

[1]http://camel.apache.org/cxfrs.html#CXFRS-ConsumingaRESTRequest-SimpleBindingStyle

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On April 5, 2014 at 4:29:25 AM, Sergey Beryozkin (sberyoz...@gmail.com) wrote:
> Willem pointed earlier on to the possibility of using ProducerTemplate.
> I saw the example somewhere today of using the native CXF JAX-WS
> declarations with the endpoint implementations additionally being
> injected with CamelContext -> getting ProducerTemplate and invoking on
> the route - the same would work for CXF JAX-RS.
> I've been actually thinking of doing something similar at the
> interceptor level but was not sure how - now it is pretty obvious how.
> You can do it yourself, have CXF in or out interceptors injected with
> Camel context and delegating to the route before or after the endpoint
> is invoked.
> That said, I know CXF RS can be used effectively on its own if you are
> keen with doing JAX-RS and be more 'close' to the Camel way of doing the
> routes
>  
> Sergey
>  
> On 04/04/14 15:34, Sergey Beryozkin wrote:
> > Hi
> >
> > It is not possible to use jaxrs:server in combination with cxfrs, it is
> > only possible to do
> >
> >  
> >  
> >
> > and then direct to from the camel route typically starting from a
> > servlet. This approach is somewhat limited unless one is prepared to
> > have JAX-RS server implementation be written with Camel API in mind.
> >
> > CXF ships org.apache.cxf.jaxrs.provider.CachingMessageBodyWriter and
> > org.apache.cxf.jaxrs.provider.CachingMessageBodyReader, the idea is that
> > that they can be used to let jaxrs:server be used in arbitrary parts of
> > the route, however I still have to experiment with them myself.
> >
> > I have another idea about making native jaxrs;server endpoints easier
> > reusable in the routes, but I haven;t had time to code them.
> >
> > have a look at CAMEL-7147, it has a project attached showing the
> > combination of cxfrs:server & cxfrs:bean
> >
> > HTH, Sergey
> >
> >
> > On 04/04/14 13:01, vrahul wrote:
> >> Thanks Sergey,
> >>
> >> I have also tried by creating services using cxf jaxrs server endpoint as
> >> below
> >>
> >>  
> >>  
> >>  
> >>  
> >>  
> >> > >> class="org.codehaus.jackson.jaxrs.JacksonJsonProvider"/>
> >>  
> >>  
> >>
> >> and used in camel
> >>
> >>  
> >>
> >> I might consider experimenting with camel restlet , http and jetty but
> >> also
> >> those will come under the scope of project, that will be my another
> >> option,
> >> better i am looking for a way to have control inside the implementation
> >> class, so at least ill be able to ExceptionMapper, as of now i am not
> >> able
> >> to use ExceptionMapper to map my custom exception with
> >> WebApplicationException
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >> http://camel.465427.n5.nabble.com/Camel-CXF-Jaxrs-service-implementation-class-s-methods-are-not-executing-tp5749733p5749794.html
> >>   
> >>
> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>
> >
>  

Reply via email to