Apache camel camel cxf中只接受第一个参数

Apache camel camel cxf中只接受第一个参数,apache-camel,cxf,apache-servicemix,Apache Camel,Cxf,Apache Servicemix,我在camel.xml中将cxf服务器定义为: <cxf:rsServer id="rsServer" address="http://0.0.0.0:9090/orderservice" serviceClass="my.pakcage.myClass" /> 在Java DSL中,我有骆驼路线: from("rsServer?bindingStyle=Default").log("rsServerlogging: ${body}") .recip

我在camel.xml中将cxf服务器定义为:

<cxf:rsServer id="rsServer" address="http://0.0.0.0:9090/orderservice"
    serviceClass="my.pakcage.myClass" />
在Java DSL中,我有骆驼路线:

from("rsServer?bindingStyle=Default").log("rsServerlogging: ${body}")
            .recipientList(simple("direct-vm:${header.operationName}"));
我正在调用POST上的
/orders/1/something
并在正文中传递一个json:
{“somethingId”:“3”}
后来,我有了一个路由,它接受
直接vm:changeOrderSomething
,并将其传递给处理器:

@Override
public void process(Exchange exchange) throws Exception {
    String body = exchange.getIn().getBody(String.class);
    LOG.info("exchange.getIn body is: {}", body);
}
我面临的问题是,在日志中,body仅为“1”,这是路径参数,这意味着我没有得到POST请求中作为body传递的内容。如果我将REST服务中的参数顺序更改为
@Body String somethingPayload、@PathParam(“id”)String orderId
,那么我将获得传递的json,而不是路径参数。 我该怎么做才能在REST中获得作为参数传递的所有内容

更新

我在某处调用对象[]时出错,因此它引发异常:

org.apache.cxf.interceptor.Fault: Failed to invoke method: [0] on null due to: java.lang.IndexOutOfBoundsException: Key: 0 not found in bean: 1 of type: java.lang.String using OGNL path [[0]] while invoking public javax.ws.rs.core.Response my.package.myClass.changeOrderSomething(java.lang.String,java.lang.String) with params [1, {
"somethingId":"3"}]

我认为这意味着REST Web服务正在获取参数,但只有第一个参数以某种方式传递给
directVM:${header.operationName}
。也许我在这里遗漏了什么?

所以我找到了答案。可以将input POST主体作为第一个参数。这使Exchange对象的主体成为传递的主体。
@PathParam
或任何其他参数可以稍后放置并通过
exchange.getIn().getHeader(“id”)
访问,因为所有这些参数都是从头访问的

org.apache.cxf.interceptor.Fault: Failed to invoke method: [0] on null due to: java.lang.IndexOutOfBoundsException: Key: 0 not found in bean: 1 of type: java.lang.String using OGNL path [[0]] while invoking public javax.ws.rs.core.Response my.package.myClass.changeOrderSomething(java.lang.String,java.lang.String) with params [1, {
"somethingId":"3"}]