java 尝试创建客户端服务库时 wsimport 失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10489191/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
wsimport fails when trying to create client service library
提问by Raul Luna
I am trying to create a client library to access Mantisfrom java. The problem is that I am getting an error and I don't know why.
我正在尝试创建一个客户端库来从 Java访问Mantis。问题是我收到一个错误,我不知道为什么。
Running this command:
运行此命令:
wsimport http://www.mantisbt.org/demo/api/soap/mantisconnect.php?wsdl
simply fails. It is supposed to create some kind of client libraries for access to the service from java, but I get this error:
根本就失败了。它应该创建某种客户端库以从 java 访问服务,但我收到此错误:
[ERROR] "Use of SOAP Encoding is not supported.
SOAP extension element on line 1,075 in http://www.mantisbt.org/demo/api
/soap/mantisconnect.php?wsdl has use="encoded" "
I looked on internet and there are vague references to this error, that it seems as an error of an directive, but it is not the case: I've tried to fix this problem with a downloaded version of the xml and it didn't work.
我在互联网上查看了对这个错误的模糊引用,这似乎是一个指令的错误,但事实并非如此:我试图用下载的 xml 版本解决这个问题,但它没有工作。
I think I could need some kind of catalogue for achieve this generation succesfully, could it be?? If so, does anyone how to create this?? I made some search but my knowledge of web services in general is too limited to achieve that.
我想我可能需要某种目录才能成功实现这一代,是吗?如果是这样,有没有人如何创建这个?我进行了一些搜索,但我对网络服务的一般知识太有限,无法实现。
Thanks in advance,
提前致谢,
采纳答案by Robert Munteanu
Is using Axis 1.4 an option? If it is, we have deployed Axis 1 SOAP stubs for MantisBTon Maven central.
使用 Axis 1.4 是一种选择吗?如果是,我们已经在 Maven 中心部署了 MantisBT 的 Axis 1 SOAP 存根。
Alternatively there is a source project on Github at jerr/mantis-ws-clientwhich should how to build artifacts with JAX-RPC.
或者,在 Github 上的jerr/mantis-ws-client上有一个源项目,它应该如何使用 JAX-RPC 构建工件。
回答by dcbyers
The crux of the issue is that the mantis WSDL is describing an rpc/encoded web service and that style is not supported in the modern wsimport tool.
问题的关键在于 mantis WSDL 描述的是 rpc/编码的 Web 服务,而现代 wsimport 工具不支持该样式。
A good writeup of the different types of web service styles is at http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/.
http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/ 上有一篇关于不同类型的 Web 服务样式的好文章。
A related question and self-service answer is provided at Best way to consume RPC/encoded webservice?. That answer makes the comment 'I'm also in doubt about using JAX-RPC for this job, because it's way out-dated.', but that really is what you are dealing with here so using the 'old library' really would be the correct way to go.
使用 RPC/encoded webservice 的最佳方式提供了相关问题和自助服务答案?. 该答案使评论“我也怀疑使用 JAX-RPC 来完成这项工作,因为它已经过时了。”,但这确实是您在这里处理的问题,因此使用“旧库”确实是正确的方法。