Details
Description
Autogeneration of a client using a WSDL with a segment like this:
<s:complexType name="ArrayOfAnyType">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="anyType" nillable="true"/>
</s:sequence>
</s:complexType>
Generates a ArrayOfAnyType.Factory.parse method like this:
try {
while (!reader.isStartElement() && !reader.isEndElement())
reader.next();
if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){
java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type");
if (fullTypeName!=null){
java.lang.String nsPrefix = null;
if (fullTypeName.indexOf(":") > -1)
nsPrefix = nsPrefix==null?"":nsPrefix;
java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1);
if (!"ArrayOfAnyType".equals(type))
}
}
// Note all attributes that were handled. Used to differ normal attributes
// from anyAttributes.
java.util.Vector handledAttributes = new java.util.Vector();
reader.next();
while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
if (reader.isStartElement()){
nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
if (!"true".equals(nillableValue) && !"1".equals(nillableValue))
else
{ reader.getElementText(); // throw away text nodes if any. } reader.next();
} // End of if for expected property start element
else {
}
while (!reader.isStartElement() && !reader.isEndElement())
reader.next();
if (reader.isStartElement())
{ // A start element we are not expecting indicates a trailing invalid property throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); }} catch (javax.xml.stream.XMLStreamException e)
{ throw new java.lang.Exception(e); }Which basically reads the first element in the array and then treats the next one as an unexpected element. So the error "Unexpected element anyType" is produced.
I regenerated the client using XMLBeans instead of ADB and it seems to be fine.