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

黑夜小凡 发布于 2014/10/10 08:51
阅读 593
收藏 0

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


加载中
0
蠢猪
UserRequest should be of type com.bstek.ws.UserRequest, not java.lang.String
返回顶部
顶部