错误总结-apache-CXF

本文针对WS交互中出现的各类异常进行解析,包括客户端和服务端的配置问题、接口重复定义及包冲突等,并提供了相应的解决思路。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

客户端
1、Could not find wsdl:binding operation info for web method print.
客户端接口加@WebService

2、org.apache.cxf.interceptor.Fault: Unexpected wrapper element {http://CXF.myweb.com/}printResponse found. Expected {http://CXFa.myweb.com/}printResponse.
服务端和客户端package不一致
3、Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:”http://cxf.myweb.com/“, local

@WebService
public interface IHelloWorldService {
@WebResult(name=”return”,targetNamespace=”http://cxf.myweb.com/”)
public String say(String name);

}
4、

Exception in thread "main" java.lang.IllegalArgumentException: An operation with name [{http://helloworld.cxf.myweb.com/}sayHi] already exists in this service

发布接口重复(不支持多态???)
5、包冲突
java.lang.NoSuchMethodError: javax.wsdl.xml.WSDLReader.readWSDL(Ljavax/wsdl/xml/WSDLLocator;Lorg/w3c

服务器:
1、Could not load Webservice SEI
实现类的endpointInterface的路径写错

2、Unexpected wrapper element {http://cxf.myweb.com/}getReader found.   Expected {http://reader.cxf.myweb.com/}getReader.
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:159)
    at $Proxy37.getReader(Unknown Source)

服务点实现类没指定endpointInterface

Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"name"). Expected elements are (none)

序列化对象增加

@XmlRootElement(name="Reader")  
@XmlAccessorType(XmlAccessType.FIELD)  
@XmlType(propOrder={"name","password"})  

将头部文件
原来

cvc-complex-type.2.3: Element 'web-app' cannot have character [children], because the type's content
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值