Apache axis2 wsdl2java异常:未知协议:d

Apache axis2 wsdl2java异常:未知协议:d,java,soap,wsdl,axis2,wsdl2java,Java,Soap,Wsdl,Axis2,Wsdl2java,我正在尝试使用axis2 wsdl2java转换器从wsdl创建java文件。问题是,我一直得到这个奇怪的异常,我真的无法解释 目前,我正在使用Wikipedia中的示例代码来测试这一点 基本上我这样称呼这个程序 wsdl2java -o "D:\Examples\SOAP" -wv 2 -uri "D:\Examples\test.wsdl" 每次我得到这个例外 Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGene

我正在尝试使用axis2 wsdl2java转换器从wsdl创建java文件。问题是,我一直得到这个奇怪的异常,我真的无法解释

目前,我正在使用Wikipedia中的示例代码来测试这一点

基本上我这样称呼这个程序

wsdl2java -o "D:\Examples\SOAP" -wv 2 -uri "D:\Examples\test.wsdl"
每次我得到这个例外

Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
: Error parsing WSDL
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:159)
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: WSDLException: faultCode=ERROR: Exception occured while reading WSDL
2.0 doc: unknown protocol: d: org.apache.axis2.AxisFault: unknown protocol: d
    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at org.apache.axis2.description.WSDL20ToAxisServiceBuilder.readInTheWSDL
File(WSDL20ToAxisServiceBuilder.java:1172)
    at org.apache.axis2.description.WSDL20ToAxisServiceBuilder.<init>(WSDL20
ToAxisServiceBuilder.java:153)
    at org.apache.axis2.description.WSDL20ToAllAxisServicesBuilder.<init>(WS
DL20ToAllAxisServicesBuilder.java:53)
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:102)
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: java.net.MalformedURLException: unknown protocol: d
    at java.net.URL.<init>(URL.java:574)
    at java.net.URL.<init>(URL.java:464)
    at java.net.URL.<init>(URL.java:413)
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
    at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:180)
    at org.apache.axis2.description.WSDL20ToAxisServiceBuilder.readInTheWSDL
File(WSDL20ToAxisServiceBuilder.java:1168)
    ... 5 more

    at org.apache.axis2.description.WSDL20ToAxisServiceBuilder.<init>(WSDL20
ToAxisServiceBuilder.java:155)
    at org.apache.axis2.description.WSDL20ToAllAxisServicesBuilder.<init>(WS
DL20ToAllAxisServicesBuilder.java:53)
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:102)
    ... 2 more
线程“main”org.apache.axis2.wsdl.codegen.CodeGenerationException中的异常 :解析WSDL时出错 位于org.apache.axis2.wsdl.codegen.CodeGenerationEngine(CodeGenerationEngine.java:159) 位于org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35) 位于org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24) 原因:WSDLException:faultCode=错误:读取WSDL时发生异常 2.0文档:未知协议:d:org.apache.axis2.AxisFault:未知协议:d 位于org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) 位于org.apache.axis2.description.WSDL20ToAxisServiceBuilder.readInTheWSDL 文件(WSDL20ToAxisServiceBuilder.java:1172) 位于org.apache.axis2.description.WSDL20ToAxisServiceBuilder(WSDL20 ToAxisServiceBuilder.java:153) 位于org.apache.axis2.description.WSDL20ToAllAxisServicesBuilder(WS DL20ToAllAxisServicesBuilder.java:53) 位于org.apache.axis2.wsdl.codegen.CodeGenerationEngine(CodeGenerationEngine.java:102) 位于org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35) 位于org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24) 原因:java.net.MalformedURLException:未知协议:d 位于java.net.URL。(URL.java:574) 在java.net.URL.(URL.java:464) 在java.net.URL.(URL.java:413) 位于org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(未知源) 位于org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(未知源) 位于org.apache.xerces.parsers.XML11Configuration.parse(未知源) 位于org.apache.xerces.parsers.XML11Configuration.parse(未知源) 位于org.apache.xerces.parsers.XMLParser.parse(未知源) 位于org.apache.xerces.parsers.DOMParser.parse(未知源) 位于org.apache.xerces.jaxp.DocumentBuilderImpl.parse(未知源) 位于javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:180) 位于org.apache.axis2.description.WSDL20ToAxisServiceBuilder.readInTheWSDL 文件(WSDL20ToAxisServiceBuilder.java:1168) ... 还有5个 位于org.apache.axis2.description.WSDL20ToAxisServiceBuilder(WSDL20 ToAxisServiceBuilder.java:155) 位于org.apache.axis2.description.WSDL20ToAllAxisServicesBuilder(WS DL20ToAllAxisServicesBuilder.java:53) 位于org.apache.axis2.wsdl.codegen.CodeGenerationEngine(CodeGenerationEngine.java:102) ... 还有两个 有人知道这可能是什么原因吗

编辑 例外情况2:

Woden[Warning],0:0,Description-1001,The targetNamespace 'http://www.tmsws.com/wsdl20sample' is not dereferencable.
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
: Error parsing WSDL
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:153)
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: org.apache.axis2.AxisFault: Unable to find element {http://www.tmsws.com/wsdl20sample}request reffered to by operation Get
    at org.apache.axis2.description.WSDL20ToAxisServiceBuilder.createAxisMessage(WSDL20ToAxisServiceBuilder.java:1112)
    at org.apache.axis2.description.WSDL20ToAxisServiceBuilder.populateOperations(WSDL20ToAxisServiceBuilder.java:1053)
    at org.apache.axis2.description.WSDL20ToAxisServiceBuilder.processInterface(WSDL20ToAxisServiceBuilder.java:956)
    at org.apache.axis2.description.WSDL20ToAxisServiceBuilder.processService(WSDL20ToAxisServiceBuilder.java:384)
    at org.apache.axis2.description.WSDL20ToAxisServiceBuilder.populateService(WSDL20ToAxisServiceBuilder.java:272)
    at org.apache.axis2.description.WSDL20ToAllAxisServicesBuilder.populateAllServices(WSDL20ToAllAxisServicesBuilder.java:90)
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:105)
    ... 2 more
Woden[Warning],0:0,Description-1001,targetNamespace'http://www.tmsws.com/wsdl20sample'是不可解引用的。
线程“main”org.apache.axis2.wsdl.codegen.CodeGenerationException中的异常
:解析WSDL时出错
位于org.apache.axis2.wsdl.codegen.CodeGenerationEngine(CodeGenerationEngine.java:153)
位于org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
位于org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
原因:org.apache.axis2.AxisFault:找不到元素{http://www.tmsws.com/wsdl20sample}Get操作引用的请求
位于org.apache.axis2.description.WSDL20ToAxisServiceBuilder.createAxisMessage(WSDL20ToAxisServiceBuilder.java:1112)
位于org.apache.axis2.description.WSDL20ToAxisServiceBuilder.populateOperations(WSDL20ToAxisServiceBuilder.java:1053)
位于org.apache.axis2.description.WSDL20ToAxisServiceBuilder.processInterface(WSDL20ToAxisServiceBuilder.java:956)
位于org.apache.axis2.description.WSDL20ToAxisServiceBuilder.processService(WSDL20ToAxisServiceBuilder.java:384)
位于org.apache.axis2.description.WSDL20ToAxisServiceBuilder.populateService(WSDL20ToAxisServiceBuilder.java:272)
位于org.apache.axis2.description.WSDL20ToAllAxisServicesBuilder.populateAllServices(WSDL20ToAllAxisServicesBuilder.java:90)
位于org.apache.axis2.wsdl.codegen.CodeGenerationEngine(CodeGenerationEngine.java:105)
... 还有两个
wsdl2java-o“D:\Examples\SOAP“-wv2-uri”文件:/D:/Examples/test.wsdl“


wsdl2java
尝试从
D:\…
URL读取,您需要指定URL(我认为有办法指定本地文件而不是URL)。

仍然会得到相同的异常unfortunately@dominos确保文件包含有效的WSDL数据,并在帖子中更新stacktrace,我不认为找到文件是个问题,因为如果我把wv改成1.1,它会开始抱怨使用了描述标签而不是定义(这意味着它已经找到了文件)。也不需要更新堆栈跟踪,因为当我添加file:并更改斜杠时,异常保持不变。我知道您的答案是关于此异常的。但问题是wsdl文件中没有对d:的引用。我只是引用了d:,但什么都没有出现。wsdl看起来像什么?它是否引用了
d:
?我说我现在使用的是wikipedia示例,即