Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 19373 invoked from network); 3 Jan 2007 14:17:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jan 2007 14:17:53 -0000 Received: (qmail 91495 invoked by uid 500); 3 Jan 2007 14:17:56 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 91342 invoked by uid 500); 3 Jan 2007 14:17:55 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 91331 invoked by uid 99); 3 Jan 2007 14:17:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jan 2007 06:17:55 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jan 2007 06:17:48 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id CADE27142FB for ; Wed, 3 Jan 2007 06:17:27 -0800 (PST) Message-ID: <7047258.1167833847827.JavaMail.jira@brutus> Date: Wed, 3 Jan 2007 06:17:27 -0800 (PST) From: "Ole Dalgaard (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Commented: (AXIS2-1928) Wrong code generation when xs:extension used in schema In-Reply-To: <19398480.1167779847663.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AXIS2-1928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461960 ] Ole Dalgaard commented on AXIS2-1928: ------------------------------------- I experience exactly the same problem using Axis2 1.1 and IBM jdk 1.4.2 on Windows XP. > Wrong code generation when xs:extension used in schema > ------------------------------------------------------ > > Key: AXIS2-1928 > URL: https://issues.apache.org/jira/browse/AXIS2-1928 > Project: Apache Axis 2.0 (Axis2) > Issue Type: Bug > Components: adb > Environment: Windows XP, JDK 1.4 > Reporter: Ram Lakshmanan > > Axis2 with ADB Binding generates wrong code when complexType elements are built with xs:extension. Here goes excerpt from our schema: > > > > > > > > > > Generated code doesn't parses the elements present in "acct-d1:Reference_Type". It totally ignores them. In the generated code you can easy that it's parsing only the: "svc-acct:keyGrpHogan" and not the elements in "acct-d1:Reference_Type". Here goes the generated code's parse() API: > public static Reference_Type349 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ > Reference_Type349 object = new Reference_Type349(); > int event; > 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 = fullTypeName.substring(0,fullTypeName.indexOf(":")); > nsPrefix = nsPrefix==null?"":nsPrefix; > java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); > if (!"Reference_Type".equals(type)){ > //find namespace for the prefix > java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); > return (Reference_Type349)com.wellsfargo.eai_schemas.provider.aps.accountinquiry.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(); > > boolean isReaderMTOMAware = false; > > try{ > isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); > }catch(java.lang.IllegalArgumentException e){ > isReaderMTOMAware = false; > } > > > reader.next(); > > > while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); > > if (reader.isStartElement() && new javax.xml.namespace.QName("http://service.wellsfargo.com/entity/account/2003/","keyGrpHogan").equals(reader.getName())){ > > object.setKeyGrpHogan(com.wellsfargo.service.entity.account._2003.KeyGrpHogan_Type.Factory.parse(reader)); > > reader.next(); > > } // End of if for expected property start element > > while (!reader.isStartElement() && !reader.isEndElement()) > reader.next(); > if (reader.isStartElement()) > // A start element we are not expecting indicates a trailing invalid property > throw new java.lang.RuntimeException("Unexpected subelement " + reader.getLocalName()); > > } catch (javax.xml.stream.XMLStreamException e) { > throw new java.lang.Exception(e); > } > return object; > } > }//end of factory class > Do let me know, if you need any further information. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org