gpt4 book ai didi

java - 从 WSDL 创建 Java API

转载 作者:行者123 更新时间:2023-11-30 04:43:54 33 4
gpt4 key购买 nike

我想创建java类或使用此WSDL中的API(https://secure.myclang.com/app/api/soap/public/wsdl/index.php?version=1.10)我尝试了axis2 -1.6.2,但我没有让它工作..

有人可以帮助我,还是 WSDL 有问题?

我得到的错误:

 C:\Users\Gynnad\Downloads\axis2-1.5.1-bin\axis2-1.5.1\bin>wsdl2java.bat -uri 
https://secure.myclang.com/app/api/soap/public/wsdl/index.php?version=1.10
Using AXIS2_HOME: C:\Users\Gynnad\Downloads\axis2-1.6.2-bin\axis2-1.6.2
Using JAVA_HOME: C:\Program Files (x86)\Java\jdk1.6.0_31
Retrieving document at 'https://secure.myclang.com/app/api/soap/public/wsdl/index.php?version=1.10'.
log4j:WARN No appenders could be found for logger (org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder).log4j:WARN Please initialize the log4j system properly.
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(CodeGenerationEngine.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(SimpleDBExtension.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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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 https://secure.myclang.com/app/api/soap/public/index.php?version=1.10
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:1952)
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

最佳答案

您可以尝试一下:

WSDL2JAVA

编辑:

根据您的错误,我认为问题出在 WSDL 本身:

org.apache.axis2.schema.SchemaCompilationException: can not find type {http://schemas.xmlsoap.org/soap/encoding/}Array from the parent schema https://secure.myclang.com/app/api/soap/public/index.php?version=1.10

关于java - 从 WSDL 创建 Java API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11579507/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com