@Override public void configure() throws Exception { from("restlet:http://0.0.0.0:8080/orders?restletMethods=POST") .bean("orderService", "createOrder"); from("restlet:http://0.0.0.0:8080/orders/{id}?restletMethods=GET") .bean("orderService", "getOrder(${header.id})"); from("restlet:http://0.0.0.0:8080/orders?restletMethods=PUT") .bean("orderService", "updateOrder"); from("restlet:http://0.0.0.0:8080/orders/{id}?restletMethods=DELETE") .bean("orderService", "cancelOrder(${header.id})"); } }
@Override public void configure() throws Exception { // use CXF-RS to setup the REST web service using the resource class // and use the simple binding style which is recommended to use from("cxfrs:http://localhost:8080?resourceClasses=camelinaction.RestOrderService&bindingStyle=SimpleConsumer") // call the route based on the operation invoked on the REST web service .toD("direct:${header.operationName}"); // routes that implement the REST services from("direct:createOrder") .bean("orderService", "createOrder"); from("direct:getOrder") .bean("orderService", "getOrder(${header.id})"); from("direct:updateOrder") .bean("orderService", "updateOrder"); from("direct:cancelOrder") .bean("orderService", "cancelOrder(${header.id})"); } }
@Override public void configure() throws Exception { // use CXF-RS to setup the REST web service using the resource class // and use the simple binding style which is recommended to use from("cxfrs:http://localhost:8080?resourceClasses=camelinaction.RestOrderService&bindingStyle=SimpleConsumer") // call the route based on the operation invoked on the REST web service .toD("direct:${header.operationName}"); // routes that implement the REST services from("direct:createOrder") .bean("orderService", "createOrder"); from("direct:getOrder") .bean("orderService", "getOrder(${header.id})"); from("direct:updateOrder") .bean("orderService", "updateOrder"); from("direct:cancelOrder") .bean("orderService", "cancelOrder(${header.id})"); } }
@Override public void configure() throws Exception { // use CXF-RS to setup the REST web service using the resource class // and use the simple binding style which is recommended to use from("cxfrs:http://localhost:8080?resourceClasses=camelinaction.RestOrderService&bindingStyle=SimpleConsumer&providers=#jsonProvider") // call the route based on the operation invoked on the REST web service .toD("direct:${header.operationName}"); // routes that implement the REST services from("direct:createOrder") .bean("orderService", "createOrder"); from("direct:getOrder") .bean("orderService", "getOrder(${header.id})"); from("direct:updateOrder") .bean("orderService", "updateOrder"); from("direct:cancelOrder") .bean("orderService", "cancelOrder(${header.id})"); } }
@Override public void configure() throws Exception { // use CXF-RS to setup the REST web service using the resource class // and use the simple binding style which is recommended to use from("cxfrs:http://localhost:8080?resourceClasses=camelinaction.RestOrderService&bindingStyle=SimpleConsumer&providers=#jsonProvider") // call the route based on the operation invoked on the REST web service .toD("direct:${header.operationName}"); // routes that implement the REST services from("direct:createOrder") .bean("orderService", "createOrder"); from("direct:getOrder") .bean("orderService", "getOrder(${header.id})"); from("direct:updateOrder") .bean("orderService", "updateOrder"); from("direct:cancelOrder") .bean("orderService", "cancelOrder(${header.id})"); } }
@Override public void configure() throws Exception { // enable Jackson json type converter getContext().getProperties().put("CamelJacksonEnableTypeConverter", "true"); // allow Jackson json to convert to pojo types also getContext().getProperties().put("CamelJacksonTypeConverterToPojo", "true"); from("restlet:http://0.0.0.0:8080/orders?restletMethods=POST") .bean("orderService", "createOrder"); from("restlet:http://0.0.0.0:8080/orders/{id}?restletMethods=GET") .bean("orderService", "getOrder(${header.id})"); from("restlet:http://0.0.0.0:8080/orders?restletMethods=PUT") .bean("orderService", "updateOrder"); from("restlet:http://0.0.0.0:8080/orders/{id}?restletMethods=DELETE") .bean("orderService", "cancelOrder(${header.id})"); } }