You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by rouble <r....@gmail.com> on 2011/12/09 21:15:27 UTC

CXF's wsdl2java ignores elements default initialization

Hi All,

Is there a way to use jaxb annotations and/or wsdl2java to generate
classes with default initializations?

Today, CXF's wsdl2java is ignoring an elements default initialization.
So, something like:
<xs:element default="true" name="bar" type="xs:boolean"/>

Does not get reflected in the class as an initialization value.

I have a thread on SO discussing the topic:
http://stackoverflow.com/questions/8434963/default-initialization-value-for-jaxb-generated-class

tia,
rouble

Re: CXF's wsdl2java ignores elements default initialization

Posted by Glen Mazza <gm...@talend.com>.
I don't believe it's so much wsdl2java ignoring the defaults as JAXB 
ignoring them (we use Oracle's JAXB reference implementation).  JAXB 
does not implement 100% of XML Schema, including default values.  You 
might have more luck with the XMLBeans databinding option.

Glen

On 12/09/2011 03:15 PM, rouble wrote:
> Hi All,
>
> Is there a way to use jaxb annotations and/or wsdl2java to generate
> classes with default initializations?
>
> Today, CXF's wsdl2java is ignoring an elements default initialization.
> So, something like:
> <xs:element default="true" name="bar" type="xs:boolean"/>
>
> Does not get reflected in the class as an initialization value.
>
> I have a thread on SO discussing the topic:
> http://stackoverflow.com/questions/8434963/default-initialization-value-for-jaxb-generated-class
>
> tia,
> rouble


-- 
Glen Mazza
Talend Community Coders
http://coders.talend.com
blog: http://www.jroller.com/gmazza


Re: CXF's wsdl2java ignores elements default initialization

Posted by Daniel Kulp <dk...@apache.org>.
On Friday, December 09, 2011 3:15:27 PM rouble wrote:
> Hi All,
> 
> Is there a way to use jaxb annotations and/or wsdl2java to generate
> classes with default initializations?
> 
> Today, CXF's wsdl2java is ignoring an elements default initialization.
> So, something like:
> <xs:element default="true" name="bar" type="xs:boolean"/>
> 
> Does not get reflected in the class as an initialization value.

See:

http://cxf.apache.org/cxf-xjc-dv.html


Dan




> 
> I have a thread on SO discussing the topic:
> http://stackoverflow.com/questions/8434963/default-initialization-value-for-
> jaxb-generated-class
> 
> tia,
> rouble
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com