开发者社区 问答 正文

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)

展开
收起
a123456678 2016-03-17 13:55:26 3453 分享 版权
1 条回答
写回答
取消 提交回答
  • UserRequest should be of type com.bstek.ws.UserRequest, not java.lang.String

    2019-07-17 19:05:17
    赞同 展开评论
问答地址: