问题描述
如何使用wsimport(或任何其他提供类似功能的工具)生成所需的文件以与JAX-WS Web服务进行通信,但不仅要将JAXB注释添加到请求/响应类,还要添加杰克逊注释吗?
How can I use wsimport (or any other tool that provides similar funcionality for that matter) to generate the required files to talk to a JAX-WS webservice, but not only have it add JAXB annotation to the request/response classes, but also add Jackson annotations?
在大图中,我不想复制,我想重用生成的类用于REST服务。如果以上是不可能的,有没有其他方法可以避免重复所有事情?
In the big picture, I do not want to duplicate, I want to reuse the generated classes for a REST service. If the above is not possible, is there any other way that saves me from duplicating everything?
推荐答案
如评论中所述, Jackson
有一个 JAXB Annotations
模块,可以使用 JAXB
注释类旁边/而不是标准 Jackson
带注释的类...
As mentioned in a comment, Jackson
has a JAXB Annotations
module, that can use JAXB
annotated classes beside / instead of standard Jackson
annotated ones...
参见:
这篇关于wsimport生成包含Jackson注释的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!