【发布时间】:2012-10-23 11:06:11
【问题描述】:
我尝试通过给出以下命令,使用 cxf(版本 2.2.3、2.2.6 和 2.7.0)从 wsdl 生成存根和客户端
> wsdl2java.bat -p com.easynet.eordering.client -client http://expediter.staging.gis.easynet.com:7001/cds/services/eordering?wsdl
但我收到一个错误
WSDLToJava 错误:非唯一的身体部位!在港口,操作必须 线路上具有独特的操作签名,以确保成功发送。在 端口 {http://eordering.uk.easynet.net}eorderingPortSOAP,操作 “{http://eordering.uk.easynet.net}getAMList”和 "{http://eordering.uk.easynet.net}getDCList" 有同样的请求 正文块 {http://eordering.uk.easynet.net}userListRequest
我知道为什么会抛出这个错误,在我的wsdl操作中写成
<operation name="getDCList"><input message="tns:userListRequest"/><output message="tns:userListResponse"/></operation>
<operation name="getAMList"><input message="tns:userListRequest"/><output message="tns:userListResponse"/></operation>
我只是为这两个操作重用了 userListRequest 参数,我相信由于两个操作中指定了相同的参数(userListRequest)而引发了错误。
有什么方法可以避免这个错误而不改变 wsdl 吗? (据我所知,wsdl 1.2 不允许操作重载,但输入参数重载?)。
【问题讨论】: