Axis2的wsdl2java在RPC /编码样式的Web服务上失败 [英] Axis2's wsdl2java fails on RPC/Encoded style web services

查看:138
本文介绍了Axis2的wsdl2java在RPC /编码样式的Web服务上失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Axis2有替代品吗?或者让它工作的方式(例如,不同的数据绑定)?

Is there any alternative to Axis2? Or the way to make it work (different data binding, for example)?

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也失败了:(

NOTE: Apache CXF fails as well :(

推荐答案

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

There are only 3 options that I have found that can be used in Java for old-style rpc/encoded web services:

1)SUN的JAX-RPC参考实现( wscompile

1) SUN's reference implementation of JAX-RPC (wscompile)

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

2) WebLogic's clientgen (I used 8.1 version)

3)Axis1 v1.4 wsdl2java

3) Axis1 v1.4 wsdl2java

最初我们使用了Axis 1.4,相对来说它的性能相当差大型服务响应(> 20k),即与没有解析的普通HTTP请求相比,客户端处理时间增加了两倍以上。如果响应变大,时间会增加。只需30多秒即可将1MB大容量反序列化。

Originally we used Axis 1.4 for that and it showed quite poor performance on relatively large service responses (>20k) i.e. client processing time increased more than twice comparing to plain HTTP request without parsing. And the time grows if response gets bigger. It took more than 30s to just deserialize 1MB large respose.

SUN生成的客户端并没有真正起作用,并且根据请求失败并显示以下消息:

SUN's generated client didn't really work and it failed on request with the message:

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

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

I have tried using WebLogic's 8.1 clientgen, and compared client code to Axis 1.4 generated client's performance. And Axis won the race. So, even though Axis client is performing not that good on relatively large responses it still is the best option out there for old rpc/encoded web services :(.

这篇关于Axis2的wsdl2java在RPC /编码样式的Web服务上失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆