Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 61546 invoked from network); 28 Apr 2006 02:58:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Apr 2006 02:58:15 -0000 Received: (qmail 32759 invoked by uid 500); 28 Apr 2006 02:58:04 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 32667 invoked by uid 500); 28 Apr 2006 02:58:03 -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 32648 invoked by uid 99); 28 Apr 2006 02:58:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Apr 2006 19:58:03 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Apr 2006 19:58:02 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B173941000F for ; Fri, 28 Apr 2006 02:57:38 +0000 (GMT) Message-ID: <6999052.1146193058724.JavaMail.jira@brutus> Date: Fri, 28 Apr 2006 02:57:38 +0000 (GMT+00:00) From: "Chuck Williams (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Commented: (AXIS2-608) Generated ADB code fails on omitted scalar minOccurs=0 elements and recursive data types In-Reply-To: <12707638.1145855825795.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 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/AXIS2-608?page=comments#action_12376861 ] Chuck Williams commented on AXIS2-608: -------------------------------------- FYI, I expect to have a patch with a complete solution very soon. All Axis2 tests pass (after patching the MinOccurs tests as before to accept null property values for arays when minOccurs=0 and the no element property is present) and most of my application runs. One complex recursive data type case failed -- I'm rebuilding and retesting a fix for that now. This patch handles minOccurs=0, recursive data types, choice and enforces the order of properties in sequences. I tried to do this with the new state machine code, but ran into too many problems, I think these would need considerably more work before they would be in a releasable state. E.g., I don't see how they handle consolidation of CHARARACTER events, CDATA sections, or unresolved ENTITY references, and I found issues in some of the state transitions. So, to resolve all parts of this issue, I used the approach outlined above, i.e. the "choice" template (which is the patched 0.94 code) is used for all cases, and has been extended to enforce the oder of properties for sequence types. Patch coming very soon. > Generated ADB code fails on omitted scalar minOccurs=0 elements and recursive data types > ---------------------------------------------------------------------------------------- > > Key: AXIS2-608 > URL: http://issues.apache.org/jira/browse/AXIS2-608 > Project: Apache Axis 2.0 (Axis2) > Type: Bug > Components: databinding > Versions: 1.0 > Environment: All > Reporter: Chuck Williams > Assignee: Ajith Harshana Ranabahu > Attachments: codegen.patch > > The patches I submitted previously (AXIS2-523) to fix various cases of minOccurs=0 and recusive data types have been applied in 1.0 RC2 only for elements whose types are choice particles. The underlying problems remain in all other cases. > One case of minOccurs=0 that fails is for an omitted scalar element (maxOccurs=1). Consider a simple string-valued element S, and a element C that contains S with minOccurs=0. The Factory.parse() method for C generates code to parse S that creates a SimpleElementReaderStateMachine with setElementNameToTest() S and then calls it. But there is no S, so the state machine fails. > An example of a recusive data type problem occurs when an element E contains an array-valued sub-element also named E. The parser for the outer E leaves the reader positioned at its own start element and then proceeds to search for the array by scanning forward looking for the first . It find itself and not the inner E! > The patch resolves this issue and a set of related issues by creating a loop invariant for the reader position. Specifically, the reader is always after the end element of the prior element (or initially after the outer start element) when it seeks to parse an inner element. I don't believe the code generator can ever parse correctly without having the reader position be a loop invariant. This is why getElementTextProperly() is essential -- because getElementText() itself fails to position the reader properly in some cases and it is unfortunately now in commons, as documented in the comment in ADBBeanTemplate.xsl. > I was able to resolve these issues by using in all cases the template that RC2 calls out as a special case for choice particles, i.e., by simply deleting the altnerative template. Perhaps there are issues with this template that caused it to be called out specially and used only for particles, but I do not know what they are. I have a complex application that uses all of these wsdl features and more that is working perfectly with this template. > All axis2 tests pass with this template, but only after fixing a bug in one test that is related to the issues here (PopulateMinOccurs0Test failed when an omitted MinOccurs=0 parameter was actually missing). > The attached patch against modules/codegen fixes the issues in both ADBBeanTemplate.xsl and PopulateMinOccurs0Test.java. This patch also contains the patch at AXIS-607. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira