Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 52147 invoked from network); 19 Jan 2010 14:04:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Jan 2010 14:04:25 -0000 Received: (qmail 91218 invoked by uid 500); 19 Jan 2010 14:04:24 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 91128 invoked by uid 500); 19 Jan 2010 14:04:24 -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 91119 invoked by uid 99); 19 Jan 2010 14:04:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jan 2010 14:04:24 +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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jan 2010 14:04:14 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8DDA8234C498 for ; Tue, 19 Jan 2010 06:03:54 -0800 (PST) Message-ID: <1222594120.337811263909834579.JavaMail.jira@brutus.apache.org> Date: Tue, 19 Jan 2010 14:03:54 +0000 (UTC) From: "Holger King (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Issue Comment Edited: (AXIS2-4607) WSDL2Java generates Java code for databindung (ADBBean) that is never reached when using custom datatypes (Map) within a WSDL: proper object creation fails In-Reply-To: <221564936.336221263905034385.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AXIS2-4607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802229#action_12802229 ] Holger King edited comment on AXIS2-4607 at 1/19/10 2:02 PM: ------------------------------------------------------------- The above if-condition in the generated "Map.java"-ADBBean is never true, so the object could never be filled with the corresponding entries. When parsing the SOAP-request, the current XML-tag used when checking the above if-condition is: Hint: - the above SOAP-request is created by an Axis1-client using identically the same WSDL!!! - Axis1 uses the property "sendMultiRefs" enabled when sending the SOAP-request was (Author: kih1fe): The above if-condition in the generated "Map.java"-ADBBean is never true, so the object could never be filled with the corresponding entries. When parsing the SOAP-request, the current XML-tag used when checking the above if-condition is: Hint: the above SOAP-request is created by an Axis1-client using identically the same WSDL!!! > WSDL2Java generates Java code for databindung (ADBBean) that is never reached when using custom datatypes (Map) within a WSDL: proper object creation fails > ----------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: AXIS2-4607 > URL: https://issues.apache.org/jira/browse/AXIS2-4607 > Project: Axis2 > Issue Type: Bug > Components: codegen > Affects Versions: 1.5.1 > Environment: Axis2 official release 1.5.1 > Reporter: Holger King > Priority: Blocker > Attachments: Map.java > > > When having a WSDL containing a Map (referencing 0..* MapItem) datatype that is used in some messages (here in "listObjects"): > ... > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ... > the "WSDL2JAVA" codegenerator creates following classes "ListObjects.java" and "Map.java": > "ListObjects.java" calls the "parse(reader)" method of the static inner class of the generated "Map.java": > ... > while (!reader.isStartElement() && !reader.isEndElement()) > reader.next(); > if (reader.isStartElement() && new javax.xml.namespace.QName("","in1").equals(reader.getName())) { > object.setIn1(com.xxx.fs.idm.axis2.types.Map.Factory.parse(reader)); > reader.next(); > } // End of if for expected property start element > ... > where the if-condition within the "parse(reader)"-method is never true (according to the below SOAP-Request!!!) to create a proper Java object containing all transported values: > public static ListObjects parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { > ... > if (reader.isStartElement() && new javax.xml.namespace.QName("","item").equals(reader.getName())) { > // Process the array and step past its final element's end. > list1.add(com.xxx.fs.idm.axis2.types.MapItem.Factory.parse(reader)); > > //loop until we find a start element that is not part of this array > boolean loopDone1 = false; > while(!loopDone1) { > // We should be at the end element, but make sure > while (!reader.isEndElement()) > reader.next(); > // Step out of this element > reader.next(); > // Step to next element event. > while (!reader.isStartElement() && !reader.isEndElement()) > reader.next(); > if (reader.isEndElement()) { > //two continuous end elements means we are exiting the xml structure > loopDone1 = true; > } else { > if (new javax.xml.namespace.QName("","item").equals(reader.getName())) { > list1.add(com.xxx.fs.idm.axis2.types.MapItem.Factory.parse(reader)); > } else { > loopDone1 = true; > } > } > } > // call the converter utility to convert and set the array > object.setItem((com.xxx.fs.idm.axis2.types.MapItem[]) > org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(com.xxx.fs.idm.axis2.types.MapItem.class, list1)); > } > ... > Here a SOAP-Request for the "listObjects" operation: > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > > xmlns:ns1="urn:webservice.test.com"> > ROLES > > test > test > > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > xsi:type="ns2:Map" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:ns2="http://xml.apache.org/xml-soap"> > > searchFilter > > > > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > xsi:type="ns3:Map" xmlns:ns3="http://xml.apache.org/xml-soap" > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> > > role > * > > > > > Important: a proper Java databinding object creation fails! -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.