Using JAXB binding extensions in wsimport

喜夏-厌秋 提交于 2019-12-02 02:26:05

问题


I know how to enable extensions in a plain JAXB bindings file - list them in the root element's extensionBindingPrefixes:

<jaxb:bindings 
    version="1.0"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
    jaxb:extensionBindingPrefixes="xjc"
    ...>

However, a JAX-WS bindings file doesn't have anywhere to put this attribute.

<jaxws:bindings
    version="2.0"
    xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
    wsdlLocation="../wsdl/schema.wsdl"
    ...>

It cannot go in the root, nor in any of the nested jaxb:bindings elements.

How are you supposed to enable binding extensions?


Example command-line arguments used by jaxws-maven-plugin:2.4.1:

-keep
-s 'target/generated-sources/wsimport'
-d 'target/classes'
-encoding UTF-8
-extension
-Xnocompile
-B-XJsr303Annotations
-B-Xvalue-constructor
-B-Xinheritance
-b 'src/jaxws/bindings.xml'
'src/wsdl/schema.wsdl'

来源:https://stackoverflow.com/questions/39640430/using-jaxb-binding-extensions-in-wsimport

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!