On Thu, Jan 31, 2013 at 7:04 PM, Richa <rsinha2...@gmail.com> wrote:
> Hi,
> I want to invoke a rest service using apache camel. Currently i am using the
> cxfrs component to configure my endpoint. My route looks like below:
>
> from("cxfrs://http://localhost:8080/RestServiceApp/?resourceClasses="com.sample.Server.HelloWorld";).log("Route
> Started");
>
> My problem is that i want to invoke a method present in the server class
> (HelloWorld in my case). Can you please tell me how do i call a particular
> method?
>

When you use from, then you let Camel expose a REST service. You want
the opposite, to call a REST service on a remote server.
So for that you need to use .to instead.

So you need to consider when to invoke this REST service, what
triggers that call?

You can use a timer to call it at every X period

from timer
  to cxfrs

Or you can also just invoke it from java code using a ProducerTemplate
http://camel.apache.org/producertemplate.html



>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/RestFul-service-using-camel-tp5726656.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to