File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes arrayType generation from WSDL element ? maxOccurs= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "arrayType generation from WSDL element ? maxOccurs="unbound"" Watch "arrayType generation from WSDL element ? maxOccurs="unbound"" New topic
Author

arrayType generation from WSDL element ? maxOccurs="unbound"

dileep keely
Ranch Hand

Joined: Jun 28, 2010
Posts: 98
<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

Joined: May 03, 2011
Posts: 39
Try using the -a parameter also called -all parameter when calling wsdl2java and see if that fixes the problem.
dileep keely
Ranch Hand

Joined: Jun 28, 2010
Posts: 98
I got it fixed by using the <xsd:choice>
and
maxOccurs="unbound"
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 577

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.


Cheers,
Naren
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: arrayType generation from WSDL element ? maxOccurs="unbound"