Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getter for boolean properties with JAXB

Tags:

xml

jaxb

xsd

jax-ws

I´m trying to expose services using jax-ws but the first surprise i got was that Weblogic does not support inner classes for request/response objects. After get over this situation here, i´m facing another challenge:

Generate getXXX() rather than/additionally to the isXXX() Method.

I need to generate this methods cause when i start the service i get the message:

<WS data binding error>could not find getter for property 'IsXXX' on com.foo.MyClass

Tried a customization:

<jaxb:globalBindings generateIsSetMethod="false" enableJavaNamingConventions="false">

without effect. :(

Any help?

like image 325
paulosuzart Avatar asked Oct 14 '08 17:10

paulosuzart


2 Answers

This has been fixed or better to say supported in jaxb 2.1.13 ( see JAXB-131 for more details). Upgrade your dependencies and configure enableIntrospection xjc option. More details on xjc options can be found on this link. If you're using org.codehause.mojo:jaxb2-maven-plugin:1.3.1 plugin see this issue comment for a workaround.

Option: -enableIntrospection

like image 190
Stevo Slavić Avatar answered Oct 12 '22 04:10

Stevo Slavić


Here is another plugin which resolves the issue:

http://code.google.com/p/nebulent-xjc-booleangetter/wiki/AboutThisProject

It geneates the getXXX() addiotionally to the default isXXX() , hence, code already using these classes do not break after applying the plugin.

like image 31
rainer198 Avatar answered Oct 12 '22 02:10

rainer198