开发者社区> 问答> 正文

cxf做客户端调用报错,请大神看看是怎么回事??报错

我按照网上的教程写了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)


展开
收起
爱吃鱼的程序员 2020-06-14 21:18:49 537 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    <spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">UserRequestshouldbeoftypecom.bstek.ws.UserRequest,notjava.lang.String

    2020-06-14 21:19:08
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载