CXF中定义方法时返回值的类名跟方法名不能一样

比如:

ListVirtualServerStatuses listVirtualServerStatuses(
            @WebParam(name = "req") ListVirtualServerStatusesRequest request);

其实上面的返回值还不是完全一样的,首字母不同,但框架会统一把首字母变成小写。

除此之外,返回值去掉结尾的"Response"后与方法名一致也不行:

ListNodeStatusesResponse listNodeStatuses(
            @WebParam(name = "req") ListNodeStatusesRequest request);


否则会报下面的错误:

Two classes have the same XML type name "{http://web.88.**.****.com/}listNodeStatusesResponse". Use @XmlType.name and @XmlType.namespace to assign different names to them.
    this problem is related to the following location:
        at com.****.**.88.web.datamodel.response.ListNodeStatusesResponse
        at private com.****.**.88.web.datamodel.response.ListNodeStatusesResponse com.****.**.88.web.jaxws_asm.ListNodeStatusesResponse.listNodeStatusesRsp
        at com.****.**.88.web.jaxws_asm.ListNodeStatusesResponse
    this problem is related to the following location:
        at com.****.**.88.web.jaxws_asm.ListNodeStatusesResponse
Two classes have the same XML type name "{http://web.88.**.****.com/}listVirtualServerStatuses". Use @XmlType.name and @XmlType.namespace to assign different names to them.
    this problem is related to the following location:
        at com.****.**.88.web.jaxws_asm.ListVirtualServerStatuses
    this problem is related to the following location:
        at com.****.**.88.web.datamodel.response.ListVirtualServerStatuses
        at private com.****.**.88.web.datamodel.response.ListVirtualServerStatuses com.****.**.88.web.jaxws_asm.ListVirtualServerStatusesResponse.listVirtualServerStatusesRsp
        at com.****.**.88.web.jaxws_asm.ListVirtualServerStatusesResponse


应该是有方法可以设置的,只是没找到。试过WebResult重置名字不行。错误信息里说的重置命名空间名字,没试过。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值