Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 77093 invoked from network); 14 Oct 2006 02:11:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Oct 2006 02:11:06 -0000 Received: (qmail 51421 invoked by uid 500); 14 Oct 2006 02:10:52 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 51332 invoked by uid 500); 14 Oct 2006 02:10:52 -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 51300 invoked by uid 99); 14 Oct 2006 02:10:51 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Oct 2006 19:10:51 -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; Fri, 13 Oct 2006 19:10:50 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0E5A8714315 for ; Fri, 13 Oct 2006 19:10:05 -0700 (PDT) Message-ID: <7134240.1160791805055.JavaMail.jira@brutus> Date: Fri, 13 Oct 2006 19:10:05 -0700 (PDT) From: "Peter Smith (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Commented: (AXIS2-768) WSDL2Java (via Eclipse plugin) generates code with a bug In-Reply-To: <29475191.1148606875759.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-768?page=comments#action_12442123 ] Peter Smith commented on AXIS2-768: ----------------------------------- [[ Old comment, sent by email on Fri, 26 May 2006 11:28:11 -0700 (PDT) ]] thanks Chuck, was just starting on verifying that removing the whitespace would have seen the problem go away. thanks for the quick work! "Chuck Williams (JIRA)" wrote: [ http://issues.apache.org/jira/browse/AXIS2-768?page=all ] Chuck Williams updated AXIS2-768: --------------------------------- Attachment: ADBBeanTemplate.xsl.patch ADBBeanTemplate.xsl.patch is a patch against svn head as of today 5/26 for modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl. This patch fully resolves this issue. I was able to replicate the problem and verify the patch corrects it. The patch is precisely as noted in the prior comment. All axis2 tests pass. -- 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 --peter-- --------------------------------- Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2"/min with Yahoo! Messenger with Voice. > WSDL2Java (via Eclipse plugin) generates code with a bug > -------------------------------------------------------- > > Key: AXIS2-768 > URL: http://issues.apache.org/jira/browse/AXIS2-768 > Project: Apache Axis 2.0 (Axis2) > Issue Type: Bug > Environment: Windows XP Pro, SP2 > Axis2 (version 1.0), Eclipse plugin version 1.0 > Eclipse 3.1.2 > Reporter: Peter Smith > Assigned To: Ajith Harshana Ranabahu > Attachments: ADBBeanTemplate.xsl.patch > > > [Still new to web services.] > I generated some client code, sync style only, with adb binding. > Error occurs when running client (service-consuming) code generated by the Eclipse plugin: > "java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement StadiumInfo" > WSDL location here ( http://www.xmethods.com/ve2/ViewListing.po;jsessionid=WKLq4DIo6x-jHNRE5dafpPhj(QHyMHiRM)?key=uuid:2ED51A61-68E6-90ED-45B7-E318C299C8C5 ), or here ( http://tinyurl.com/ltook ). > The xml being consumed looks like this (snippet): > ========================================== > > > > > Round 1 > 2006-06-09 > 18:00:00 > > FIFA World Cup Stadium Munich > 59416 > Munich > > > Germany > http://www.dataaccess.nl/wk2006/flags/GERMANY_.jpg > > > Costa Rica > http://www.dataaccess.nl/wk2006/flags/COSTA___.jpg > > U > > 0 > ... > ========================================== > Things go well until 'Team1' (the second complextype) is about to be processed, at which point the 'unexpected subelement' runtime exception occurs. > I'll dive in and take a gander at what's going on - please forgive. It seems the generated code is unaware of the nested/complex nature of the 'StadiumInfo' element as relates to advancing to the next starting element, so when it tries to 'climb out/up' the tree to find the next sibling, it doesn't make it. So, instead of being positioned at the closing 'StadiumInfo' tag upon returning from parsing the 'StadiumInfo' element, it is somewhere a bit deeper - maybe at the whitespace just before the closing 'StadiumInfo' tag. The pre-ordained sequential processing means that the next element sought, in our case 'Team1', will not be found and the RuntimeException occurs. > I was able to get past this error in a couple of ways: > 1) Adding a couple more 'reader.next();' statements just above the test looking for the start of the next element. These statements must be inserted after processing all complex types. > 2) Changing the 'reader.next()' paradigm into one that doesn't pay any attention to depth level or complex types, but just looks at every 'next()' element until it satisfies the conditions we're looking for - that is, that the next starting element we find has the name we want. > Here is the generated code for a typical (simple/not-complex) element. > // do certain number of 'reader.next()' calls to skip whitespace/comments/etc., then hope you're in the right place in the tree (my comment) > if (reader.isStartElement() && > new javax.xml.namespace.QName( > "http://www.dataaccess.nl/wk2006", "sDescription").equals( > reader.getName())) { > // process the current element (my comment) > java.lang.String content = getElementTextProperly(reader); > object.setSDescription(org.apache.axis2.databinding.utils.ConverterUtil.convertTostring( > content)); > And here is another way that I hacked the generated code to get it going: > // what is the qualified name of the next element we're looking for? (my comment) > javax.xml.namespace.QName qname = new javax.xml.namespace.QName("http://www.dataaccess.nl/wk2006", "sDescription"); > // keep moving ahead until you find the element you're looking for (my comment) > while ( ! ( reader.isStartElement() && qname.equals(reader.getName())) ){ > reader.next(); > } > // process the current element (my comment) > java.lang.String content = getElementTextProperly(reader); > object.setSDescription(org.apache.axis2.databinding.utils.ConverterUtil.convertTostring( > content)); > That's it. -- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org