如何解决 WSDL2Java 创建大于 64K 的静态块?
我们当前正在使用供应商提供的非常大的 WSDL 模式。 绑定方式是RPC。 据我所知,Axis 1.x 是唯一支持 RPC WSDL 定义的 Java 工具。 如果我错了,请纠正我。
WSDL2Java 生成一个 service-nameSkeleton.java 文件,该文件具有大小为 1.3Mb 的静态初始化块 - 远远大于 Java 的 64K 限制。
鉴于我们无法更改接口的定义,您认为我们应该如何进行?
我认为我们的选择是:
- 分解生成的静态块
- 分解 WSDL(不确定是否可以)无需更改接口即可实现这一点)
- 修补 Axis WSDL2Java 代码
还有其他想法吗?
We're currently working with a vendor-provided WSDL schema that is very large. The binding style is RPC. As far as I know, Axis 1.x is the only Java tool supporting RPC WSDL definitions. Please do correct me if I'm wrong about that.
WSDL2Java generates a service-nameSkeleton.java file that has a static intialisation block 1.3Mb in size - considerably larger than Java's 64K limit.
Given that we can't change the definition of the interface, how do you think we should proceed?
Our options as I see them are:
- Break up the generated static block
- Break up the WSDL (not sure if that's possible without altering the interface)
- Patch the Axis WSDL2Java code
Any other ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅这篇文章,其中提供了一些有关如何将 RPC WSDL 转换为文档的说明。 我建议先尝试一下。
另外,您可能有一个 RPC/编码的 WSDL(顺便说一句,它不符合 WS-I)。 JAXWS 仅支持 RPC/literal。 因此任何框架(如 CXF 或 Axis2)都将支持它。 因此,您还可以尝试将 WSDL 转换为 RPC/literal。
CXF 有一个工具可以为您完成这项工作。
不管怎样,我建议尝试将 WSDL 转换为更新的形式。 这将使您的服务器和客户端实现变得更轻松。 我认为这不值得与 Axis1 进行斗争。 甚至手动编写和解析 SOAP 消息也会更容易。
See this article, which gives some instructions on how you can convert a RPC WSDL to a document one. I recommend trying that first.
Also, you probably have an RPC/encoded WSDL (which by the way, doesn't conform to WS-I). JAXWS only supports RPC/literal. So any framework (like CXF or Axis2) will support it. So, you can also try to convert the WSDL to RPC/literal.
CXF has a tool that could do the job for you.
Anyway, I recommend trying to convert the WSDL to a more recent form. This will make your life easier, both for the server and the client implementations. I don't believe that is worth fighting with Axis1. Even manually writing and parsing the SOAP messages could be easier.
如果您的 wsdl 可能会频繁更改,则可能值得修补 wsdl2java 代码,否则我会选择第一个选项。
If your wsdl is likely to change frequently, it could be worth patching the wsdl2java code, otherwise I would go for the first option.