I am using cxf wsdl2java commandline command in order to generate the client (java files). My xsd looks something like this -
<xs:complexType name="ArrayOfString">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="string" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="ConfirmSMSResults">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="1" name="sessionId" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="1" name="smsIds" type="tns:ArrayOfString"/>
</xs:sequence>
</xs:complexType>
The generated java file ConfirmSMSResults.java
has something like this
@XmlElement(required = true)
protected ArrayOfString smsIds;
where it should be protected String[] smsIds;
I had a similar problem with the date
data type defined in the xsd
file, which got converted to XMLGregorianCalendar
. However, I solved it by using an external xjb
file and defining the binding there. It could be found here. I can't seem to find something similar for my issue with the Array.
Thank you in advance.