If you are running wsdl2java on a wsdl/schema and it's not putting an 
XmlElementWrapper thing on it (actually, it's more likely to generate a wrapper 
type), then according to the schema, the wrapper element is not supposed to be 
there.   If you think it is, then my suggestion is to go back to the schema and 
edit the schema to make it match what you are expecting/requiring.

Dan



On Mar 8, 2013, at 11:41 AM, Jose María Zaragoza <[email protected]> wrote:

> Hello:

> We're creating our JAXB helper classes with wsdl2java
> All works fine, but *we would like that List elements were wrapped by
> an element.*
> But wsdl2java doesn't do it
> 
> 
> 
> For example:
> 
> @XmlRootElement
> @XmlAccessorType(XmlAccessType.FIELD)
> public class Customer {
> 
> //  ** wsdl2java doesn't create a @XmlElementWrapper **
> private List<PhoneNumber> phoneNumbers;
> 
> // setters/getters
> }
> 
> @XmlType(name="phone-number")
> public class PhoneNumber {
> 
> 
>    @XmlValue
>    private String number;
> 
> //setters/getters
> 
> }
> 
> We would like a
> 
> <phoneNumbers>
>          <phone-number>55588900</phone-number>
>          <phone-number>5555678</phone-number>
> </phoneNumbers>
> 
> 
> We could modify Customer  class by hand, but we'd like to configure
> wsdl2java to generate automatically these things
> 
> Any ideas ?
> 
> Thanks and regards

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to