Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache camel 骆驼cxf问题_Apache Camel - Fatal编程技术网

Apache camel 骆驼cxf问题

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

我有cxfwebservice,我想用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>


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配置中编写它吗?