我按照网上的教程写了CXF客户端调用,怎么会报这样的错呢?
2014-10-10 8:41:49 org.apache.cxf.common.jaxb.JAXBUtils logGeneratedClassNames
信息: Created classes: com.bstek.ws.ObjectFactory, com.bstek.ws.User, com.bstek.ws.UserRequest, com.bstek.ws.UserResponse
2014-10-10 8:41:52 org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
警告: Interceptor for {http://www.bstek.com/ws}DemoUserRequestService#{http://www.bstek.com/ws}User has thrown exception, unwinding now
java.lang.IllegalArgumentException: Part {http://www.bstek.com/ws}UserRequest should be of type com.bstek.ws.UserRequest, not java.lang.String
at org.apache.cxf.jaxb.io.DataWriterImpl.checkPart(DataWriterImpl.java:221)
at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:153)
at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:114)
at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:339)
at com.oking.TexstClient.main(TexstClient.java:24)
Exception in thread "main" java.lang.IllegalArgumentException: Part {http://www.bstek.com/ws}UserRequest should be of type com.bstek.ws.UserRequest, not java.lang.String
at org.apache.cxf.jaxb.io.DataWriterImpl.checkPart(DataWriterImpl.java:221)
at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:153)
at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:114)
at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:339)
at com.oking.TexstClient.main(TexstClient.java:24)
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">UserRequestshouldbeoftypecom.bstek.ws.UserRequest,notjava.lang.String
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。