Apache axis2 wsdl2java异常:未知协议:d
我正在尝试使用 axis2 wsdl2java 转换器从 wsdl 创建 java 文件。问题是我不断收到这个奇怪的异常,我无法真正解释。
目前我正在使用维基百科中的示例代码来测试这一点。
基本上我这样调用程序
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
有谁知道可能是什么原因造成的?
编辑 例外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
I am trying to create java files from wsdl using axis2 wsdl2java converter. The problem is that I keep getting this weird exception, which I cannot really explain.
At the moment I am using the example code in Wikipedia to test this.
Basically I call the program like this
wsdl2java -o "D:\Examples\SOAP" -wv 2 -uri "D:\Examples\test.wsdl"
And every time I get this exception
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
Does anyone know what might be causing this?
Edit
Exception 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
wsdl2java -o "D:\Examples\SOAP" -wv 2 -uri "file:/D:/Examples/test.wsdl"
wsdl2java
尝试从 < code>D:\... URL,需要指定URL(我认为有办法指定本地文件而不是URL)。wsdl2java -o "D:\Examples\SOAP" -wv 2 -uri "file:/D:/Examples/test.wsdl"
wsdl2java
tries to read from theD:\...
URL, you need to specify the URL (I think there is way to specify a local file instead of URL).