Posted by kohsuke
on January 23, 2007 at 11:37 AM PST
Controlling xjc inside wsimport via command-line option is getting easier.
My favorite feature in the JAXB RI is the simpler and better binding mode , which makes the generated code even easier to use, by ...
- Eliminating JAXBElement as much as possible
- Giving you a better, more typed binding in general
- Use plural property names where applicable
My previous entry talks about how to use it from JAXB's xjc tool, but of course you can use it from JAX-WS's wsimport tool, because JAX-WS uses JAXB for the databinding. The following example illustrates how:
<binding file="simple-binding.xjb " />
Click the "simple-binding.xjb" link above to download this file, which is pretty short. The binding element can also be an attribute on element if you only have one binding file.
In upcoming JAX-WS RI 2.1, you can also specify any XJC command line options through wsimport ant task. This is handy, for example, for you to use one of the JAXB RI plugins . The following example illustrates how:
<xjcarg file="path/to/fluent-api.jar" />
The element follows the command-line argument mechanism in Ant .