0

我想使用骆驼的 cxfrs 模块提供的简单绑定而不使用弹簧。apache网站上给出的例子使用了spring。http://camel.apache.org/cxfrs.html 谁能解释如何在没有弹簧的情况下使用简单绑定?

4

2 回答 2

1

您可以使用 Java DSL(域特定语言)。一个示例(在 RouteBuilder#configure 方法中):

CxfRsComponent cxfComponent = new CxfRsComponent(context);
CxfRsEndpoint serviceEndpoint = new CxfRsEndpoint("http:/localhost/rest", cxfComponent);
serviceEndpoint.addResourceClass(MyService.class);

from(serviceEndpoint).log("this is irrelevant");

Camel 版本是 2.16.2 (maven: org.apache.camel:camel-cxf-transport:2.16.2) CXF 版本是 3.1.4 (org.apache.cxf:cxf-rt-transports-http-jetty:3.1. 4)

于 2016-03-12T13:23:48.360 回答
0

如果不使用 Spring,很难在 cxfrs 端点上配置所有东西。但是您可以通过使用 uri 选项来完成 cxfrs 的大多数配置,例如

from("cxfrs://http://localhost:9000/context/rest?resourceClasses=org.apache.camel.component.cxf.jaxrs.testbean.CustomerServiceResource&bindingStyle=SimpleConsumer")
于 2014-09-28T01:46:45.710 回答