Having JAXB-RI and CXF. WSDL first. I want a generated class of mine to implement Serializable
. I now have the following binding xml, which works (the SEI class name gets changed)
<jaxws:bindings xmlns:xsd="http://www.w3.org/2001/XMLSchema" ...>
<bindings node="wsdl:definitions/wsdl:portType[@name='Foo']">
<!-- change the generated SEI class -->
<class name="IFooService" />
</bindings>
</jaxws:bindings>
No, in this context, where and what should I add. I tried:
<xsd:annotation>
<xsd:appinfo>
<jaxb:globalBindings>
<xjc:serializable uid="12343" />
</jaxb:globalBindings>
</xsd:appinfo>
</xsd:annotation>
and
<jxb:globalBindings>
<jxb:serializable/>
</jxb:globalBindings>
both inside and outside the <bindings>
tag - either Serializable
is not added, or classes are not generated at all (without any error).
See also this thread
So, how exactly to do that
I made it work in two ways:
Using a second binding file, which is JAXB-only, as the one Pascal showed in his answer
By specifying another
<bindings>
tag that handles the whole namespace:You can implement an XJC plugin to do that:
Then, you can add the plugin to the SchemaCompiler options: