Apache camel 骆驼cxf问题
我有cxfwebservice,我想用camel来称呼它 有人能帮我吗 我的消息来源是:Apache camel 骆驼cxf问题,apache-camel,Apache Camel,我有cxfwebservice,我想用camel来称呼它 有人能帮我吗 我的消息来源是: <camel:camelContext xmlns="http://camel.apache.org/schema/spring"> <camel:package>com.aliti.integeration</camel:package> <route> <from uri="cxf:bean:helloService
<camel:camelContext xmlns="http://camel.apache.org/schema/spring">
<camel:package>com.aliti.integeration</camel:package>
<route>
<from uri="cxf:bean:helloService?defaultOperationName=sayHello"/>
<from uri="cxf:bean:helloService?defaultOperationName=sayHi"/>
<log message=">>>> ${body}"/>
</route>
</camel:camelContext>
com.aliti.integration
类似的内容将在localhost:8080/test上公开服务,并通过您的路由发送请求
from(cxf://http://localhost:8080/test?serviceClass=com.aliti.integeration.HelloService)
.choice()
.when(header(CxfConstants.OPERATION_NAME).isEqualTo("sayHello"))
setBody(constant("hello")
.when(header(CxfConstants.OPERATION_NAME).isEqualTo("sayHi"))
setBody(constant("hi");
...
public interface HelloService {
String sayHello();
String sayHi();
}
有关更多信息,请查看页面,这是一个CXFRS示例…只需在代码中尝试camel;在那里你可以选择你的方法。但是在DSL模式下我不知道 就像博迪说的:
.choice()
.when(header(CxfConstants.OPERATION_NAME).isEqualTo("sayHello"))
setBody(constant("hello")
.when(header(CxfConstants.OPERATION_NAME).isEqualTo("sayHi"))
setBody(constant("hi");
我试过了,但什么都没有。你知道如何在XML配置中编写它吗?