[英]Camel CXF Soap Client calling web service with multiple input parameters
[英]CXF web service with multiple parameters
我正在使用Camel和CXF开发Web服务并使用“代码优先”方法。 对于具有单个参数的方法,一切正常。 但是,具有多个参数的方法仅接收第一个参数,其他参数解析为空值。 没有异常被抛出。
这是我的路线:
<route>
<from uri="cxf:bean:serverEndPoint" />
<log message=">>> data is : ${body}"/>
<choice>
<when>
<simple>${in.header.operationName} == 'doSomething'</simple>
<to uri="bean:TestWSBean?method=doSomething"/>
</when>
...
</route>
服务器端点定义如下:
<cxf:cxfEndpoint id="serverEndPoint"
address="http://localhost:9000/casServer/"
serviceClass="com.test.iface.TestWebService">
<cxf:inInterceptors>
<ref bean="loggingInInterceptor"/>
</cxf:inInterceptors>
<cxf:outInterceptors>
<ref bean="loggingOutInterceptor"/>
</cxf:outInterceptors>
</cxf:cxfEndpoint>
而实现bean本身:
@WebService
public interface TestWebService {
public String doSomething(String one, String two);
}
我的问题非常基本,能够发送多个参数应该怎么做?
我想你需要使用requestwrappper注释。 看一下cxf中wsdl_first示例生成的代码。 它生成注释和合适的包装类。
@RequestWrapper(localName =“updateCustomer”,targetNamespace =“http://customerservice.example.com/”,className =“com.example.customerservice.UpdateCustomer”)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.