java wsimport 重命名/不同的 ObjectFactory.java
我在使用 wsimport
时遇到问题。在我的一个必须进行 wsimport 的 wsdl 中,我有一个名为 "objectFactory"
的复杂类型。有什么方法可以告诉命令 wsimport
创建,同时导入不同的类来维护 JAXB 连接,例如 ObjectFactory.java
。换句话说,我可以告诉 wsimport
而不是创建 ObjectFactory.java
一些自定义类,如 MyCustomFactory.java
吗?
是否可以以 complexType name="objectFactory"
映射到具有不同名称的对象(例如 MyObjectFactory.java
)的方式自定义映射?
谢谢
I'm having problem with wsimport
. In one of my wsdl which has to be wsimport
ed I have a complexType with name "objectFactory"
. Is there any way to tell command wsimport
to create while importing different class for maintaining JAXB connections such is ObjectFactory.java
. In other words can I tell wsimport
instead of creating ObjectFactory.java
some custom class like MyCustomFactory.java
?
Is it possible to customize mapping in such a way that complexType name="objectFactory"
would map to object with different name like MyObjectFactory.java
?
Thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JAX-WS(
wsimport
是其中的一部分)使用 JAXB 生成 XML 绑定文件(并进行实际绑定)。因此,您需要查看有关自定义 JAXB 绑定的文档。它也适用于您的情况。在您的情况下,您将使用类似以下内容:
此示例用于 XML 架构/WSDL 中的内联自定义。您还可以将此信息作为外部配置提供。
JAX-WS (of which
wsimport
is a part) uses JAXB for generating the XML binding files (and for doing the actual binding). So you'll want to check out this documentation on customizing JAXB bindings. It applies just as well to your case.In your case you'd use something like this:
This example is for inline customization in your XML Schema/WSDL. You can also provide this information as external configuration.