Apache camel 公开cxfweb服务

Apache camel 公开cxfweb服务,apache-camel,jbossfuse,Apache Camel,Jbossfuse,我试图使用Camel公开JAX-WSWebService(一个带注释的Java类)。使用单个参数时,Web服务将正确响应。另一方面,当使用对象或多个参数作为参数时,它不起作用。 以下是我在JBoss Fuse上部署的蓝图: <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:camelcxf="http://camel.apache.org/schema/blueprint/cxf" xmlns:cxf="


我试图使用Camel公开JAX-WSWebService(一个带注释的Java类)。使用单个参数时,Web服务将正确响应。另一方面,当使用对象或多个参数作为参数时,它不起作用。 以下是我在JBoss Fuse上部署的蓝图:

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:camelcxf="http://camel.apache.org/schema/blueprint/cxf" xmlns:cxf="http://cxf.apache.org/blueprint/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd              http://camel.apache.org/schema/blueprint/cxf http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd              http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd              http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
   <camelcxf:cxfEndpoint id="demo-target-cxf" address="http://localhost:9000/SourceExample/hello" serviceClass="com.sample.SourceExampleWSImpl" endpointName="SourceExamplePort" serviceName="SourceExampleService" />
   <camelContext xmlns="http://camel.apache.org/schema/blueprint" id="fuse-demo-route-exmple-cxf">
      <route id="demo-target-cxf">
         <from uri="cxf:bean:demo-target-cxf" />
         <transform>
            <simple>${in.body}</simple>
         </transform>
         <log message="Message input: ${in.body}" />
         <removeHeaders pattern="CamelHttp*" />
      </route>
   </camelContext>
</blueprint>
捆绑ic正确部署在JBoss Fuse上。调用Web服务时,只计算第一个参数。例如,使用参数1和4调用:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://sample.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <sam:getTotal>
         <arg0>1</arg0>
         <arg1>4</arg1>
      </sam:getTotal>
   </soapenv:Body>
</soapenv:Envelope>

1.
4.
返回:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:getTotalResponse xmlns:ns2="http://sample.com/">
         <return>1</return>
      </ns2:getTotalResponse>
   </soap:Body>
</soap:Envelope>

1.
知道怎么修吗?
谢谢

您的意思是预期输出应该是

1+4=5
因为应该调用以下代码

 public int getTotal(int x, int y) {
        return x+y;
    }
如果不是这样,那么当您使用camelcxf作为bean时,bean只定义契约,实现中的代码不在使用中


如果您只需要一个标准的SOAP-WS并编写java代码来构建和处理SOAP请求/响应,那么只需使用普通的CXF。

尝试将@WebParam作为getTotal中的参数。不确定它是否解决了问题。谢谢,但是它没有解决问题。非常感谢克劳斯的回复。我将做一些检查并提供一些反馈。当做
 public int getTotal(int x, int y) {
        return x+y;
    }