Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

arrayType generation from WSDL element ? maxOccurs="unbound"

 
dileep keely
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • 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
 
Rudy Gireyev
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • 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: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it fixed by using the <xsd:choice>
and
maxOccurs="unbound"
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic