gpt4 book ai didi

java - Axis2 的 wsdl2java 在 RPC/编码样式 Web 服务上失败

转载 作者:搜寻专家 更新时间:2023-10-30 21:25:22 28 4
gpt4 key购买 nike

是否有 Axis2 的替代方案?或者使其工作的方式(例如,不同的数据绑定(bind))?

Retrieving document at '...'.
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:271)
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:224)
... 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 ... at org.apache.axis2.schema.SchemaCompiler.copyMetaInfoHierarchy(SchemaCompiler.java:1296)
at org.apache.axis2.schema.SchemaCompiler.processComplexContent(SchemaCompiler.java:1258)
at org.apache.axis2.schema.SchemaCompiler.processContentModel(SchemaCompiler.java:1153)
at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:1097)
at org.apache.axis2.schema.SchemaCompiler.processNamedComplexSchemaType(SchemaCompiler.java:1017)
at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:931)
at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:766)
at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:552)
at org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:1991)
at org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:1874)
at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:1081)
at org.apache.axis2.schema.SchemaCompiler.processNamedComplexSchemaType(SchemaCompiler.java:1017)
at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:931)
at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:766)
at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:552)
at org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:1991)
at org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:1874)
at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:1081)
at org.apache.axis2.schema.SchemaCompiler.processAnonymousComplexSchemaType(SchemaCompiler.java:980)
at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:934)
at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:592)
at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:563)
at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:370)
at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:280)
at org.apache.axis2.schema.ExtensionUtility.invoke(ExtensionUtility.java:103)
... 8 more

注意:Apache CXF 也失败了 :(

最佳答案

我发现只有 3 个选项可以在 Java 中用于旧式 rpc/编码的 web 服务:

1) SUN对JAX-RPC的引用实现(wscompile)

2)WebLogic的clientgen(我用的是8.1版本)

3) Axis1 v1.4 wsdl2java

最初我们为此使用 Axis 1.4,它在相对较大的服务响应 (>20k) 上显示出相当差的性能,即与没有解析的普通 HTTP 请求相比,客户端处理时间增加了两倍多。如果响应变大,时间也会变长。仅反序列化 1MB 大响应就花了 30 多秒。

SUN 生成的客户端并没有真正工作,它根据请求失败并显示消息:

unexpected element name: 
expected=getSubscriberInfoReturn,
actual={ws.generated.api}getSubscriberInfoReturn

我曾尝试使用 WebLogic 的 8.1 clientgen,并将客户端代码与 Axis 1.4 生成的客户端性能进行比较。 Axis 心国赢得了比赛。因此,即使 Axis 客户端在相对较大的响应上表现不佳,它仍然是旧 rpc/编码 Web 服务的最佳选择:(。

关于java - Axis2 的 wsdl2java 在 RPC/编码样式 Web 服务上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1357483/

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