请教webservice客户端问题
本帖最后由 一见穿心 于 2011-05-24 17:06 编辑
我写了一个webservice客户端,但是执行的时候就报错,查了很多资料也没找到是什么原因,请熟悉的朋友帮忙看看吧。谢谢了先!webservice服务端成功发布。
WS客户端源码:
- public static void main(String[] args) throws MalformedURLException, Exception {
- System.out.println("Test begin");
- FpXxRequest fpxxReq = new FpXxRequest();
- FpXxResponse fpxxres = new FpXxResponse();
- Client client = new Client(new URL("http://127.0.0.1:7001/WebRoot/services/IvrWebService?wsdl"));
- Object[] results = client.invoke("findFpXx", new Object[] { fpxxReq });
- System.out.println("Test end");
- }
复制代码报错如下:
- Exception in thread "main" org.codehaus.xfire.fault.XFireFault: Unable to write 'com.zrar.ivrwebservice.FpXxRequest@eac5a' [com.zrar.ivrwebservice.FpXxRequest]. Type is unknown.
- at org.codehaus.xfire.aegis.type.basic.ObjectType.handleNullType(ObjectType.java:234)
- at org.codehaus.xfire.aegis.type.basic.ObjectType.writeObject(ObjectType.java:169)
- at org.codehaus.xfire.aegis.AegisBindingProvider.writeParameter(AegisBindingProvider.java:200)
- at org.codehaus.xfire.service.binding.AbstractBinding.writeParameter(AbstractBinding.java:273)
- at org.codehaus.xfire.service.binding.DocumentBinding.writeMessage(DocumentBinding.java:65)
- at org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerializer.java:80)
- at org.codehaus.xfire.transport.http.HttpChannel.writeWithoutAttachments(HttpChannel.java:56)
- at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.getByteArrayRequestEntity(CommonsHttpMessageSender.java:313)
- at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.send(CommonsHttpMessageSender.java:251)
- at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:123)
- at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
- at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
- at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
- at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
- at org.codehaus.xfire.client.Client.invoke(Client.java:335)
- at org.codehaus.xfire.client.Client.invoke(Client.java:349)
- at WSTest.main(WSTest.java:32)
复制代码感觉提示显示FpXxRequest这个类型未知,但是在客户端我已经吧FpXxRequest相关的类都加进来了。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论