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一定要引用接口的实现类