我有cxf webservice,我想通过camel调用它。
有人能帮帮我吗。
我的消息来源是:
<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>发布于 2011-06-10 02:27:09
下面这样的代码将在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-cxf页面、cxf unit tests和此blog post……
发布于 2014-05-01 01:38:44
只需在代码中尝试camel;在那里您可以选择您的方法。但是在DSL模式下我不知道。
就像波迪说的那样:
.choice()
.when(header(CxfConstants.OPERATION_NAME).isEqualTo("sayHello"))
setBody(constant("hello")
.when(header(CxfConstants.OPERATION_NAME).isEqualTo("sayHi"))
setBody(constant("hi");https://stackoverflow.com/questions/6291579
复制相似问题