Apache camel 使用cxf rs组件调用传递动态键值参数的rest服务

Apache camel 使用cxf rs组件调用传递动态键值参数的rest服务,apache-camel,fuseesb,jbossfuse,Apache Camel,Fuseesb,Jbossfuse,我必须创建一个Fuse服务,它反过来调用由外部服务提供者公开的REST服务。Fuse服务将接收XML格式的请求,并在调用REST服务之前转换为查询字符串 Fuse服务的示例请求XML- <CustomerDetails> <CustomerName>ABC</CustomerName> <CustomerAge>28</CustomerAge> <CustomerName>DEF</CustomerName> &

我必须创建一个Fuse服务,它反过来调用由外部服务提供者公开的REST服务。Fuse服务将接收XML格式的请求,并在调用REST服务之前转换为查询字符串

Fuse服务的示例请求XML-

<CustomerDetails>
<CustomerName>ABC</CustomerName>
<CustomerAge>28</CustomerAge>
<CustomerName>DEF</CustomerName>
<CustomerAge>54</CustomerAge>
<CustomerDetails>
REST服务使用键值参数中的请求,并以XML格式响应

示例URL:

我试着搜索了很多,但在网上找不到任何教程

是否有人可以提供建议,说明如何使用cxf rs组件(最好是Spring DSL驼峰配置)实现fuse服务


提前感谢..

如果您只想将XML请求转换为url参数,您可以使用来解组请求并使用bean对象来设置URI请求参数。您不需要使用camel cxf组件

from("direct:start").unmarshal(jaxb).process(new Processor() {
      public void process(Exchange exchange) throws Exception {
          // get the request object
          CustomerDetail request = exchange.getIn().getBody();
          // Just mapping the request object into a query parameters.
          String query = requestToParameter(request);
          exchange.getIn().setHeader(Exchange.HTTP_QUERY, query);
          // to remove the body, so http endpoint can send the request with Get Method 
          exchange.getIn().setBody(null);
     }).to("https://www.customer.com/cust/api/v1/store/abc.xml");