java wsimport "无法解析名称..."
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2455218/
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 "Cannot resolve the name..."
提问by Pierre
I've been trying to import the following web service: http://soap.genome.jp/KEGG.wsdlwith ${JAVA_HOME}/bin/wsimport:
我一直在尝试使用 ${JAVA_HOME}/bin/wsimport导入以下 Web 服务:http://soap.genome.jp/KEGG.wsdl:
wsimport -version
JAX-WS RI 2.1.6 in JDK 6
but I got the following error:
但我收到以下错误:
parsing WSDL...
[WARNING] src-resolve: Cannot resolve the name 'soapenc:Array' to a(n) 'type definition' component.
line 19 of http://soap.genome.jp/KEGG.wsdl#types?schema1
[ERROR] undefined simple or complex type 'soapenc:Array'
line 19 of http://soap.genome.jp/KEGG.wsdl
(....)
Does the problem comes from the WSDL or from the implementation of wsimport ? should I use another tool ?
问题是来自 WSDL 还是来自 wsimport 的实现?我应该使用其他工具吗?
Thanks
谢谢
Pierre
皮埃尔
采纳答案by TastyWheat
I found (what is apparently) a workaround from this bug report: https://netbeans.org/bugzilla/show_bug.cgi?id=116987
我从这个错误报告中找到了(显然是什么)一个解决方法:https: //netbeans.org/bugzilla/show_bug.cgi?id=116987
Basically you need to add schemaLocaionto your importdefinition:
基本上你需要添加schemaLocaion到你的import定义中:
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"
schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" />
回答by skaffman
soapenc:Arrayindicates a non-standard style of web service encoding called "RPC Encoding". This is a very old style that used to be popular on Microsoft platforms; it's obsolete (i.e. it's not part of the WS-I spec) and not supported by modern tools like JAX-WS.
soapenc:Array表示一种称为“RPC 编码”的非标准 Web 服务编码样式。这是微软平台上曾经流行的一种非常古老的风格;它已经过时(即它不是 WS-I 规范的一部分)并且不受 JAX-WS 等现代工具的支持。
The only java tool that I know of that supports RPC encoded web services is Apache Axis 1.
我所知道的唯一支持 RPC 编码 Web 服务的 Java 工具是Apache Axis 1。

