Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 37760 invoked from network); 14 Sep 2009 10:49:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Sep 2009 10:49:01 -0000 Received: (qmail 86288 invoked by uid 500); 14 Sep 2009 10:49:01 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 86087 invoked by uid 500); 14 Sep 2009 10:49:00 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 86078 invoked by uid 500); 14 Sep 2009 10:49:00 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 86075 invoked by uid 99); 14 Sep 2009 10:49:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Sep 2009 10:49:00 +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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Sep 2009 10:48:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 17F0A2388909; Mon, 14 Sep 2009 10:48:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r814572 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java Date: Mon, 14 Sep 2009 10:48:33 -0000 To: axis2-cvs@ws.apache.org From: amilas@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090914104834.17F0A2388909@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: amilas Date: Mon Sep 14 10:48:33 2009 New Revision: 814572 URL: http://svn.apache.org/viewvc?rev=814572&view=rev Log: fixed the issue AXIS2-4071. check the existence of an element before adding it to the schema. Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?rev=814572&r1=814571&r2=814572&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java (original) +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java Mon Sep 14 10:48:33 2009 @@ -1753,6 +1753,25 @@ Document ownerDocument = schemaElement.getOwnerDocument(); + String newElementName = newElement.getAttribute(XSD_NAME); + + // check whether this element already exists. + NodeList nodeList = schemaElement.getChildNodes(); + Element nodeElement = null; + for (int i = 1; i < nodeList.getLength(); i++) { + if (nodeList.item(i) instanceof Element){ + nodeElement = (Element) nodeList.item(i); + if (nodeElement.getLocalName().equals(XML_SCHEMA_ELEMENT_LOCAL_NAME)){ + if (nodeElement.getAttribute(XSD_NAME).equals(newElementName)){ + // if the element already exists we do not add this element + // and just return. + return; + } + } + } + + } + // loop through the namespace declarations first and add them String[] nameSpaceDeclarationArray = (String[]) namespacePrefixMap .keySet().toArray(new String[namespacePrefixMap.size()]);