You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by immobilia <im...@hotmail.com> on 2011/02/05 00:48:14 UTC

Wsdl2java : how to auto-generate field array/List ?

I follow "Defining Contract first webservices with wsdl generation from java"
:
http://cxf.apache.org/docs/defining-contract-first-webservices-with-wsdl-generation-from-java.html

When i generate WSDL to Java, attribute "address[]" (List<String> address)
is in my class.
The getter is generated.
But the setter is missing ...

<xs:element maxOccurs="unbounded" minOccurs="0" name="address"
nillable="true" type="xs:string"/>

Only the setters on maxOccurs="unbounded" are missing.

wsdl2java don't generate attributes[] ? Is a way to generate setters on
array attributes ?

Thanks.


-- 
View this message in context: http://cxf.547215.n5.nabble.com/Wsdl2java-how-to-auto-generate-field-array-List-tp3372022p3372022.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Wsdl2java : how to auto-generate field array/List ?

Posted by Glen Mazza <gm...@talend.com>.
That's per the JAXB specification -- you don't set the list, rather, you 
get the list and then add whatever elements you want to it.

There's a collection setter injector plugin, but the link is presently 
broken:  http://java.net/projects/jaxb2-commons/pages/Home (link 11).
See here for more info on JAXB customizations:  
http://www.jroller.com/gmazza/entry/customizing_jaxb_artifacts

HTH,
Glen

On 04.02.2011 18:48, immobilia wrote:
> I follow "Defining Contract first webservices with wsdl generation from java"
> :
> http://cxf.apache.org/docs/defining-contract-first-webservices-with-wsdl-generation-from-java.html
>
> When i generate WSDL to Java, attribute "address[]" (List<String>  address)
> is in my class.
> The getter is generated.
> But the setter is missing ...
>
> <xs:element maxOccurs="unbounded" minOccurs="0" name="address"
> nillable="true" type="xs:string"/>
>
> Only the setters on maxOccurs="unbounded" are missing.
>
> wsdl2java don't generate attributes[] ? Is a way to generate setters on
> array attributes ?
>
> Thanks.
>
>


-- 
Glen Mazza
Software Engineer, Talend (http://www.talend.com)
blog: http://www.jroller.com/gmazza