CXF----webservice和Spring之JaxWsProxyFactoryBean调用

1.见解
1.1 客户端的接口代码还一定要和服务端的接口代码一样,连注解都要一样,不够灵活
1.2 当客户端访问服务器的请求地址时,如果服务端没有对应的地址,就会报错,但是又没有cxf的异常捕获处理
1.3 address中的url是模糊匹配的
//服务端代码
2.UserBean.java
这里写图片描述
3.IuserDao
这里写图片描述
4.IuserDaoImpl
这里写图片描述
5.dipacher-servlet.xml
这里写图片描述
6.web.xml
这里写图片描述
7.look photo
这里写图片描述

**//客户端代码
这里写图片描述
2.客户端
这里写图片描述
CXF整合Spring之JaxWsProxyFactoryBean调用异常
1.
3.客户端
这里写图片描述
Exception in thread “main” java.lang.ClassCastException: org.apache.cxf.endpoint.ClientImpl cannot be cast to cn.hk.dao.IUserDao
at cn.webservice.client.InvokeUsersServices.main(InvokeUsersServices.java:13)

cause 是JaxWsProxyFactoryBean对象,不是JaxWsClientFactoryBean对象
2.
Exception in thread “main” javax.xml.ws.WebServiceException: Could not find wsdl:binding operation info for web method getUserName.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:113)
at $Proxy17.getUserName(Unknown Source)
at cn.webservice.client.InvokeUsersServices.main(InvokeUsersServices.java:14)

cause 客户端的接口也庶加@WebService注解
3.
object is not an instance of declaring class while invoking public java.lang.String cn.hk.dao.impl.IUserDaoImpl.getUserName(int) with params [10].
… 2 more
cause jaxws:serviceBean一定要引用接口的实现类

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值