Camel-cxf rs client bean

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Camel-cxf rs client bean

ravi.4indra
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Camel-cxf rs client bean

ceposta
I think a better way to start is what do you have so far? And what is
not working?

On Mon, Mar 31, 2014 at 7:36 PM, ravi.4indra <[hidden email]> wrote:

> Hi,
>
> I am having trouble defining a cxf rs client bean. can anyone point me the
> example of defining a cxf client bean using the http client.
>
> Any Help is appreciated
>
> Thanks
> Ravi
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-cxf-rs-client-bean-tp5749587.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta
Reply | Threaded
Open this post in threaded view
|

Re: Camel-cxf rs client bean

Tcharl
Hi,

I don't know if it will help, but I've a sample using http component to
consume an RS endpoint.
https://github.com/OsgiliathEnterprise/net.osgiliath.parent/blob/master/net.osgiliath.samples/net.osgiliath.hello/net.osgiliath.hello.routes/src/main/java/net/osgiliath/hello/routes/HelloRoute.java

Regards


2014-04-01 6:07 GMT+02:00 Christian Posta <[hidden email]>:

> I think a better way to start is what do you have so far? And what is
> not working?
>
> On Mon, Mar 31, 2014 at 7:36 PM, ravi.4indra <[hidden email]>
> wrote:
> > Hi,
> >
> > I am having trouble defining a cxf rs client bean. can anyone point me
> the
> > example of defining a cxf client bean using the http client.
> >
> > Any Help is appreciated
> >
> > Thanks
> > Ravi
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Camel-cxf-rs-client-bean-tp5749587.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Christian Posta
> http://www.christianposta.com/blog
> twitter: @christianposta
>
Reply | Threaded
Open this post in threaded view
|

Re: Camel-cxf rs client bean

ravi.4indra
This post was updated on .
In reply to this post by ceposta
Hi,

This is how my route looks like

 from("direct:start").routeId("start")
           
                .bean(Processor1.class, "prepareRequestMessage")
                .to("cxfrs:bean:rsClient?synchronous=true")
                .bean(Processor1.class, "processResponseMessage")

prepareRequestMessage method in class Processor1 is used to set headers

       
exchange.getOut().setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API,
Boolean.TRUE);
        exchange.getOut().setHeader(Exchange.HTTP_METHOD, "GET");
        exchange.getOut().setHeader("QueryParam1", "QueryParam1-value");
        exchange.getOut().setHeader("QueryParam2", "QueryParam2-value");

Below is the declaration for the bean rsClient
 <cxf:rsClient id="rsClient"
address="RESTENDPOINT"/>


Any help is appreciated.

Thanks





--
View this message in context: http://camel.465427.n5.nabble.com/Camel-cxf-rs-client-bean-tp5749587p5749637.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Camel-cxf rs client bean

ravi.4indra
In reply to this post by ceposta
Hi,

This is how my route looks like

 from("direct:start").routeId("start")
           
                .bean(Processor1.class, "prepareRequestMessage")
                .to("cxfrs:bean:rsClient?synchronous=true")
                .bean(Processor1.class, "processResponseMessage")

prepareRequestMessage method in class Processor1 is used to set headers

        exchange.getOut().setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API, Boolean.TRUE);
        exchange.getOut().setHeader(Exchange.HTTP_METHOD, "GET");
        exchange.getOut().setHeader("QueryParam1", "QueryParam1-value");
        exchange.getOut().setHeader("QueryParam2", "QueryParam2-value");

Below is the declaration for the bean rsClient
 <cxf:rsClient id="rsClient" address= "REST ENdpoint"/>


Any help is appreciated.

Thanks