• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

arrayType generation from WSDL element ? maxOccurs="unbound"

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<xsd:complexType name="data-errors">
<xsd:sequence minOccurs="0" maxOccurs="unbounded" >
<xsd:element name="error-field" type="common:error-field-type" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>

<xsd:element name="data-errors" type="commontypes:data-errors" />

I am able to generate the DataErrors class(WSDL-->JAva) but without arrayType as below:
public DataErrors(ErrorFieldType errorField) {
this.errorField = errorField;
}
public ErrorFieldType getErrorField() {
return errorField;
}


Required to achive:
----------------------
public DataErrors(ErrorField[] errorField) {
this.errorField = errorField;
}
public ErrorField[] getErrorField() {
return errorField;
}

Tried
1) maxOccurs="unbound" but was not able to.

Please suggest me
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try using the -a parameter also called -all parameter when calling wsdl2java and see if that fixes the problem.
 
dileep keely
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it fixed by using the <xsd:choice>
and
maxOccurs="unbound"
 
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dileep,

You did the right thing. The default value of minOccurs and maxOccurs is 1 and I think you are aware of <xsd:choice> is not related to this solution anyway.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic