Return-Path: Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: (qmail 79408 invoked from network); 13 Jan 2011 09:29:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Jan 2011 09:29:12 -0000 Received: (qmail 91134 invoked by uid 500); 13 Jan 2011 09:29:11 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 90894 invoked by uid 500); 13 Jan 2011 09:29:10 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 90881 invoked by uid 99); 13 Jan 2011 09:29:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Jan 2011 09:29:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Jan 2011 09:29:07 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p0D9SjXY019159 for ; Thu, 13 Jan 2011 09:28:45 GMT Message-ID: <32843266.339451294910925908.JavaMail.jira@thor> Date: Thu, 13 Jan 2011 04:28:45 -0500 (EST) From: "Andy Chapman (JIRA)" To: java-dev@axis.apache.org Subject: [jira] Updated: (AXIS2-4923) Incorrect parse function for ArrayOfAnyType In-Reply-To: <21110998.339381294910806071.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AXIS2-4923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Chapman updated AXIS2-4923: -------------------------------- Environment: Jave 1.5.0_08 Tomcat 5.5.18 Eclipse Helios Build id: 20100917-0705 Axis2 Tools (Eclipse XML Editors and Tools) Version: 1.1.100.v201005241530-78-FF0DZRDKDDePSKwHj was:Jave 1.5.0_08, Tomcat 5.5.18 > Incorrect parse function for ArrayOfAnyType > ------------------------------------------- > > Key: AXIS2-4923 > URL: https://issues.apache.org/jira/browse/AXIS2-4923 > Project: Axis2 > Issue Type: Bug > Components: adb > Affects Versions: 1.5.4 > Environment: Jave 1.5.0_08 > Tomcat 5.5.18 > Eclipse Helios Build id: 20100917-0705 > Axis2 Tools (Eclipse XML Editors and Tools) Version: 1.1.100.v201005241530-78-FF0DZRDKDDePSKwHj > Reporter: Andy Chapman > > Autogeneration of a client using a WSDL with a segment like this: > > > > > > 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 = fullTypeName.substring(0,fullTypeName.indexOf(":")); > } > nsPrefix = nsPrefix==null?"":nsPrefix; > java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); > if (!"ArrayOfAnyType".equals(type)){ > //find namespace for the prefix > java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); > return (ArrayOfAnyType)ExtensionMapper.getTypeObject(nsUri,type,reader); > } > } > } > // 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)){ > java.lang.String content = reader.getElementText(); > org.apache.axiom.om.OMFactory fac = org.apache.axiom.om.OMAbstractFactory.getOMFactory(); > org.apache.axiom.om.OMNamespace omNs = fac.createOMNamespace("http://apiconnector.com", ""); > org.apache.axiom.om.OMElement _valueAnyType = fac.createOMElement("anyType", omNs); > _valueAnyType.addChild(fac.createOMText(_valueAnyType, content)); > object.setAnyType(_valueAnyType); > } 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. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org