gpt4 book ai didi

java - 使用多个 WSDL (xmlbeans) 处理共享命名空间

转载 作者:行者123 更新时间:2023-11-30 09:54:28 25 4
gpt4 key购买 nike

我有五个共享命名空间的 WSDL,但不是全部。我从中生成客户端代码(使用 XMLBeans 进行数据绑定(bind))。他们分别编译得很好。我根据每个生成的客户端代码创建 JAR 文件。

一旦我尝试在一个项目中使用所有 JAR 文件,我就会遇到命名/编译冲突。

我想尽可能多地重复使用。有没有什么聪明的方法来处理这个问题(而不是在包结构中给每个客户端一个自己的节点)?

最佳答案

XMLBeans (2.x) faq注意 xsdconfig 的限制命名空间映射:

alt text Note: XMLBeans doesn’t support using two or more sets of java classes (in different packages) mapped to schema types/elements that have the same names and target namespaces, using all in the same class loader. Depending on the direction you are using for the java classes to schema types mapping, some features might not work correctly. This is because even though the package names for the java classes are different, the schema location for the schema metadata (.xsb files) is the same and contains the corresponding implementing java class, so the JVM will always pick up the first on the classpath. This can be avoided if multiple class loaders are used.

关于java - 使用多个 WSDL (xmlbeans) 处理共享命名空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3254094/

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