java - 使用 wsdl2java 解析 wsdl 文件会导致错误消息

标签 java xml wsdl wsdl2java mantis

我正在尝试从 wsdl 文件生成 java 客户端 stub ,但这会导致出现繁琐的错误消息:

Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGener ationEngine.java:293) at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35) at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24) Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(Simp leDBExtension.java:53) at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:246) ... 2 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:50) ... 3 more Caused by: org.apache.axis2.schema.SchemaCompilationException: can not find type {http://schemas.xmlsoap.org/soap/encoding/}Array from the parent schema http://futureware.biz/mantisconnect at org.apache.axis2.schema.SchemaCompiler.copyMetaInfoHierarchy(SchemaCompiler.java:1371) at org.apache.axis2.schema.SchemaCompiler.processComplexContent(SchemaCompiler.java:1333) at org.apache.axis2.schema.SchemaCompiler.processContentModel(SchemaCompiler.java:1228) at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:1172) at org.apache.axis2.schema.SchemaCompiler.processNamedComplexSchemaType(SchemaCompiler.java:1092) at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:1006) at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:645) at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:604) at org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:2069) at org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:1958) at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:1156) at org.apache.axis2.schema.SchemaCompiler.processNamedComplexSchemaType(SchemaCompiler.java:1092) at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:1006) at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:645) at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:604) at org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:2069) at org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:1952) at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:1156) at org.apache.axis2.schema.SchemaCompiler.processAnonymousComplexSchemaType(SchemaCompiler.java:1055) at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:1009) at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:645) at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:615) at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:423) at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:292) at org.apache.axis2.schema.ExtensionUtility.invoke(ExtensionUtility.java:102) ... 8 more

谁能告诉我这里可能出了什么问题吗?

最佳答案

WSDL 有不同的编码类型,例如 RPC/encoded、RPC/literal、Document/encoded、Document/literal。我认为您的 WSDL 使用 RPC/编码。 Axis2 不直接支持 RPC/encoded 编码风格。

这个article是关于在 Axis2 中使用 RPC/编码的 WSDL。我希望这会有所帮助。

关于java - 使用 wsdl2java 解析 wsdl 文件会导致错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19744332/

相关文章:

java ee服务器类似于cassini

Java:将 JMF 与 Codenvy IDE 结合使用?

java - 将纹理绘制到帧缓冲区会扭曲纹理

c++ - 使用 gSOAP 实现通用 SOAP 客户端

java字符串连接奇怪的行为

python - 使用 BeautifulSoup 更改元素值返回空元素

java - JAXB XML 解析问题

java - 为什么我的应用程序会暂停线程,我该如何解决这个问题?

android - 如何解决android中的SOAP Error 500

soap - Microsoft Dynamics NAV Web 服务中的日期过滤器