如何使用ApacheCamel调用RESTfulWebService

如何使用ApacheCamel调用RESTfulWebService,rest,cxf,apache-camel,Rest,Cxf,Apache Camel,我的休息服务很好 import java.util.List; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import org.hibernate.Query; import org.hibernate.Session; import org.json.JSONArray; @Path("/detailsservice/

我的休息服务很好

import java.util.List;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import org.hibernate.Query;
import org.hibernate.Session;
import org.json.JSONArray;


@Path("/detailsservice/")
public class DetailsService {
 Dao d=new Dao();

@GET
@Path("/details/{id}/")
@Produces("text/xml")

public Details getDetails(@PathParam("id") String id) {

    Session hs = d.dao();
    Details de = (Details) hs.load(Details.class,new Integer(id));

    return de;
 }
}
我使用jetty服务器在web上公开了此服务

 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
 import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;


 public class Server {

 protected Server() throws Exception {
    JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
    sf.setResourceClasses(DetailsService.class);
    System.out.println("two");
    sf.setResourceProvider(DetailsService.class, new SingletonResourceProvider(new  DetailsService()));
    sf.setAddress("http://localhost:9000/");
    sf.create();
}

public static void main(String args[]) throws Exception {
  new Server();
    System.out.println("Server ready...");

    Thread.sleep(5 * 6000 * 1000);
    System.out.println("Server exiting");
    System.exit(0);
}

}
如何使用ApacheCamel调用此服务。 请详细解释我,因为我是骆驼新手。 提前感谢

您可以使用该组件:

<route>
  <from uri="http4://localhost:9000/detailsservice/details/1234" />
  <!-- add your processors here -->
  <to uri="..." />
</route>


您知道吗?您可以使用camel http或camel-http4组件发送http请求,也可以使用camel cxfrs发送请求。任何人请帮助我。我需要一个例子。大家好,请帮助我。