From 63b5b6c3aae514177e96a7d6d214bd728d17ab12 Mon Sep 17 00:00:00 2001 From: Andreas Veithen Date: Sun, 17 Dec 2017 21:11:56 +0000 Subject: [PATCH 1/5] Create branch for AXIS2-4091. From 415e34a9591adfb3b2efe0111d4d28fbc9aa7ae6 Mon Sep 17 00:00:00 2001 From: Andreas Veithen Date: Sun, 17 Dec 2017 21:14:43 +0000 Subject: [PATCH 2/5] Apply patch for AXIS2-4091 provided by Antonio Andrade and Matt Fluet. --- .../WSDL11ToAxisServiceBuilder.java | 17 ++++++- .../WSDL11ToAxisServiceBuilderTest.java | 50 +++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java b/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java index 4c86c88c0d..2b22013744 100644 --- a/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java +++ b/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java @@ -1760,6 +1760,11 @@ private Map createSchemaForPorttype(String namespaceURI, namespacePrefixMap, boEntry); + // No wrapped element needs to be created + if (!boEntry.isWrappedInput()) { + continue; + } + elementDeclaration.appendChild(newComplexType); String namespaceToUse = namespaceURI; @@ -1849,6 +1854,12 @@ private Map createSchemaForPorttype(String namespaceURI, namespaceImportsMap, namespacePrefixMap, boEntry); + + // No wrapped element needs to be created + if (!boEntry.isWrappedInput()) { + continue; + } + elementDeclaration.appendChild(newComplexType); String namespaceToUse = namespaceURI; @@ -2253,7 +2264,11 @@ private void addPartToElement(Part part, "and use the type attribute."); } else { // The presense of an element means that a wrapper xsd element is not needed. - boe.setWrappedOutput(false); + if (isOutMessage){ + boe.setWrappedOutput(false); + } else { + boe.setWrappedInput(false); + } if (log.isDebugEnabled()) { log.debug("The binding operation " + bindingOperationName + " references message part " + diff --git a/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java b/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java index 4854c97663..7f64d71f7d 100644 --- a/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java +++ b/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java @@ -21,9 +21,18 @@ import java.io.FileInputStream; import java.io.InputStream; import java.util.List; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Set; +import java.util.HashSet; import javax.xml.namespace.QName; +import org.apache.ws.commons.schema.XmlSchema; +import org.apache.ws.commons.schema.XmlSchemaElement; +import org.apache.ws.commons.schema.XmlSchemaObject; +import org.apache.ws.commons.schema.XmlSchemaObjectCollection; + import junit.framework.TestCase; public class WSDL11ToAxisServiceBuilderTest extends TestCase { @@ -54,4 +63,45 @@ public void testMultipleFaultsWithSameMessage() throws Exception { in.close(); } } + + public void testNonDuplicatedElementsHttpBinding() throws Exception { + final String wsdlPath = "test-resources/wsdl/nonduplicatedElements.wsdl"; + InputStream in = new FileInputStream(wsdlPath); + final String targetNamespace = "http://www.example.org"; + final QName serviceName = new QName(targetNamespace, "FooService"); + final String portName = "FooHttpGetPort"; + + AxisService service = new WSDL11ToAxisServiceBuilder(in, serviceName, portName).populateService(); + List schemaDocuments = service.getSchema(); + List duplicatedGlobalElements = findDuplicatedGlobalElements(schemaDocuments); + // NO duplicated element should exists + assertTrue("Duplicated global element declarations found in '" + wsdlPath, + duplicatedGlobalElements.isEmpty()); + } + + protected List findDuplicatedGlobalElements(List schemaDocuments) { + List duplicatedGlobalElementDeclarations = new ArrayList(); + Set globalElementDeclarations = new HashSet(); + // Iterate over all schema documents + for (int i = 0; i < schemaDocuments.size(); i++) { + XmlSchema schemaDocument = (XmlSchema)schemaDocuments.get(i); + XmlSchemaObjectCollection items = schemaDocument.getItems(); + for (Iterator itemsIt = items.getIterator(); itemsIt.hasNext();) { + XmlSchemaObject xmlSchemaObject = (XmlSchemaObject)itemsIt.next(); + // Check only XML schema elements + if (xmlSchemaObject instanceof XmlSchemaElement) { + QName elementName = ((XmlSchemaElement)xmlSchemaObject).getQName(); + /* Was another element with the same name found in this or + other XML schema document? */ + if (globalElementDeclarations.contains(elementName)) { + duplicatedGlobalElementDeclarations.add(elementName); + } else { + globalElementDeclarations.add(elementName); + } + } + } + } + return duplicatedGlobalElementDeclarations; + } + } From 129ba3fde1d102684e18393f5fc0f6df77cb5553 Mon Sep 17 00:00:00 2001 From: Andreas Veithen Date: Sun, 17 Dec 2017 21:15:24 +0000 Subject: [PATCH 3/5] Add file missing in r1818512. --- .../wsdl/nonduplicatedElements.wsdl | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 modules/kernel/test-resources/wsdl/nonduplicatedElements.wsdl diff --git a/modules/kernel/test-resources/wsdl/nonduplicatedElements.wsdl b/modules/kernel/test-resources/wsdl/nonduplicatedElements.wsdl new file mode 100644 index 0000000000..93d9b452d5 --- /dev/null +++ b/modules/kernel/test-resources/wsdl/nonduplicatedElements.wsdl @@ -0,0 +1,55 @@ + + + + + + + + + + + + Message part referencing a global element declaration + + + + + + Message part referencing a type definition + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From c1d109dec878bb97ddf685fa79b73fc5cff5ee24 Mon Sep 17 00:00:00 2001 From: Andreas Veithen Date: Sun, 17 Dec 2017 22:37:10 +0000 Subject: [PATCH 4/5] Remove files from a botched merge. --- modules/parent/pom.xml | 1193 ---------------------------------------- 1 file changed, 1193 deletions(-) delete mode 100644 modules/parent/pom.xml diff --git a/modules/parent/pom.xml b/modules/parent/pom.xml deleted file mode 100644 index 42c70a292d..0000000000 --- a/modules/parent/pom.xml +++ /dev/null @@ -1,1193 +0,0 @@ - - - - - - - org.apache - apache - 8 - - 4.0.0 - org.apache.axis2 - axis2-parent - 1.7.0-SNAPSHOT - pom - Apache Axis2 - Parent - 2004 - Axis2 is an effort to re-design and totally re-implement both Axis/Java and - (eventually) Axis/C++ on a new architecture. Evolving from the now standard "handler chain" - model which Axis1 pioneered, Axis2 is developing a more flexible pipeline architecture which - can yet be managed and packaged in a more organized manner. This new design acknowledges the - maturing of the Web services space in terms of new protocols such as WS-ReliableMessaging, - WS-Security and WS-Addressing that are built on top of the base SOAP system. At the time - Axis1 was designed, while it was fully expected that other protocols such as - WS-ReliableMessaging would be built on top of it, there was not a proper extension - architecture defined to enable clean composition of such layers. Thus, one of the key - motivations for Axis2 is to provide a clean and simple environment for like Apache Sandesha - and Apache WSS4J to layer on top of the base SOAP system. Another driving force for Axis2 as - well as the move away from RPC oriented Web services towards more document-oriented, message - style asynchronous service interactions. The Axis2 project is centered on a new - representation for SOAP messages called AXIOM (AXIs Object Model). AXIOM consists of two - parts: a complete XML Infoset representation and a SOAP Infoset representation on top of - that. The XML Infoset representation provides a JDOM-like simple API but is built on a - deferred model via a StAX-based (Streaming API for XML) pull parsing API. A key feature of - AXIOM is that it allows one to stop building the XML tree and just access the pull stream - directly; thus enabling both maximum flexibility and maximum performance. This approach - allows us to support multiple levels of abstraction for consuming and offering Web services: - using plain AXIOM, using generated code and statically data-bound data types and so on. At - the time of Axis1's design, RPC-style, synchronous, request-response interactions were the - order of the day for Web services. Today service interactions are much more message - -oriented and exploit many different message exchange patterns. The Axis2 engine - architecture is careful to not build in any assumptions of request-response patterns to - ensure that it can be used easily to support arbitrary message exchange - patterns. - - http://axis.apache.org/axis2/java/core/ - - jira - http://issues.apache.org/jira/browse/AXIS2 - - - - 1.2.15-SNAPSHOT - 3.0.3-SNAPSHOT - 1.0-SNAPSHOT - 2.0.3 - - - 1.7.0 - 2.7.7 - 2.4.0 - 1.3 - 1.2 - 3.1 - 2.1 - 1.1.1 - 1.2.7 - 1.0.2 - 1.1 - 1.6 - 1.0.1 - 1.1.2 - 1.0.1 - 1.0 - 2.1 - 4.2.1 - 4.2.1 - 5.0 - 1.5rc3 - 2.2.4 - 2.2.4 - 1.3 - 1.2 - 3.8.2 - 4.4 - 1.2.15 - 2.2 - 2.0.8 - 1.1 - 2.0.7 - 2.0.7 - 2.2 - 2.4 - 1.4.9 - 1.6R7 - 2.3 - 2.5.1 - 1.0.1 - wstx-asl - org.codehaus.woodstox - 3.2.9 - 6.0.16 - 1.6.2 - 2.7.0 - 2.5.0 - 1.2 - 1.3 - 2.3 - 1.4 - 1.2 - - false - '${settings.localRepository}' - 1.1 - 2.2.5 - 2.2.5 - 1.1.1 - - - - Axis2 Developer List - java-dev-subscribe@axis.apache.org - java-dev-unsubscribe@axis.apache.org - java-dev@axis.apache.org - http://mail-archives.apache.org/mod_mbox/axis-java-dev/ - - http://markmail.org/search/list:org.apache.ws.axis-dev - - - - Axis2 User List - java-user-subscribe@axis.apache.org - java-user-unsubscribe@axis.apache.org - java-user@axis.apache.org - http://mail-archives.apache.org/mod_mbox/axis-java-user/ - - http://markmail.org/search/list:org.apache.ws.axis-user - - - - - - Saminda Abeyruwan - saminda - saminda AT wso2.com - WSO2 - - - Afkham Azeez - azeez - azeez AT wso2.com - WSO2 - http://www.apache.org/~azeez - - - Jeff Barrett - IBM - - - Eran Chinthaka - chinthaka - chinthaka AT wso2.com - WSO2 - http://www.apache.org/~chinthaka - - - Glen Daniels - gdaniels - gdaniels AT apache.org - Sonic Software - - - Brian DePradine - pradine - pradine AT uk.ibm.com - IBM - - - Jaliya Ekanayake - jaliya - jaliya AT opensource.lk - Indiana University, USA - http://www.apache.org/~jaliya - - - Ruchith Fernando - ruchithf - ruchith AT wso2.com - WSO2 - - - Nicholas Gallardo - IBM - - - Thilina Gunarathne - thilina - thilina AT opensource.lk - Lanka Software Foundation - - - Chathura Herath - chathura - chathura AT opensource.lk - Indiana University, USA - http://www.apache.org/~chathura - - - David Illsley - davidillsley - IBM - http://www.illsley.org - - - Deepal Jayasinghe - deepal - deepal AT gatech.org - Georgia Institute of Technology, USA - http://www.apache.org/~deepal - - - Robert Lazarski - robertlazarski - robertlazarski AT gmail.com - Brazil Outsource - - - Senaka Fernando - senaka - senaka AT wso2.com - WSO2 - - - Steve Loughran - stevel - stevel AT apache.org - HP labs - - - Bill Nagy - IBM - - - Chatra Nakkawita - chatra - chatra AT WSO2.com - WSO2 - - - Sumedha Rubasinghe - sumedha - sumedha AT WSO2.com - WSO2 - - - Charitha Kamkanamge - charitha - charitha AT WSO2.com - WSO2 - - - Srinath Perera - hemapani - hemapani AT apache.org - Indiana University, USA - http://www.apache.org/~hemapani - - - Ajith Ranabahu - ajith - ajith AT wso2.com - WSO2 - http://www.apache.org/~ajith - - - Venkat Reddy - venkat - vreddyp AT gmail.com - Computer Associates - - - Michael Rheinheimer - IBM - - - Ann Robinson - IBM - - - Sanka Samaranayake - sanka - sanka AT wso2.com - WSO2 - - - Rich Scheuerle - scheu - scheu AT us.ibm.com - IBM - - - Ashutosh Shahi - ashu - Ashutosh.Shahi AT ca.com - Computer Associates - - - Aleksander Slominski - alek - aslom AT cs.indiana.edu - Indiana University Extreme! Computing Lab - - - Dennis Sosnoski - dsosnoski - dms AT sosnoski.com - Sosnoski Software - - - Davanum Srinivas - dims - davanum AT gmail.com - - - Jayachandra Sekhara Rao Sunkara - jaya - jayachandra AT gmail.com - Computer Associates - - - Nandana Mihindukulasooriya - nandana - nandana AT wso2.com - WSO2 - - - Nikhil Thaker - IBM - - - Chamil Thanthrimudalige - chamil - chamil AT wso2.com - WSO2 - - - Dasarath Weerathunga - dasarath - dasarath AT opensource.lk - Purdue University, USA - - - Eranga Jayasundera - eranga - eranga AT apache.org - - - Sanjiva Weerawarana - sanjiva - sanjiva AT wso2.com - WSO2 - - - Keith Chapman - keithc - keith AT wso2.com - WSO2 - - - Andreas Veithen - veithen - veithen AT apache.org - http://www.linkedin.com/in/aveithen - - - Ruwan Linton - ruwan - ruwan AT apache.org - http://www.linkedin.com/in/ruwanlinton - - - - - Gayan Asanka - gayan AT opensource.lk - Lanka Software Foundation - - - Dharshana Dias - Lanka Software Foundation / University of Moratuwa - - - Nadana Gunarathna - nadana AT opensource.lk - Lanka Software Foundation - - - Thilini Gunawardhana - thilini AT WSO2.com - WSO2 - - - Anushka Kumara - anushkakumar AT gmail.com - Lanka Software Foundation / University of Moratuwa - - - Farhaan Mohideen - fmohideen AT valista.com - Lanka Software Foundation - - - Chinthaka Thilakarathne - Lanka Software Foundation / University of Moratuwa - - - Shivantha Huruggamuwa - shivanthah AT gmail.com - University Of Peradeniya , Sri Lanka - - - Dobri Kitipov - kdobrik AT gmail.com - Software AG - - - - - - - - apache-snapshots - Apache Snapshots Repository - http://people.apache.org/repo/m2-snapshot-repository - default - - true - daily - - - false - - - - apache.snapshots - Apache Snapshot Repository - http://repository.apache.org/snapshots - - true - daily - - - false - - - - - - - - com.sun.xml.fastinfoset - FastInfoset - ${fi.version} - - - org.apache.tomcat - tribes - ${tomcat.version} - - - org.apache.tomcat - juli - ${tomcat.version} - - - xml-resolver - xml-resolver - ${xml_resolver.version} - - - xalan - xalan - ${xalan.version} - - - xml-apis - xml-apis - - - - - com.sun.xml.bind - jaxb-impl - ${jaxbri.version} - - - com.sun.xml.bind - jaxb-xjc - ${jaxbri.version} - - - javax.xml.bind - jaxb-api - ${jaxb.api.version} - - - javax.xml.stream - stax-api - - - javax.activation - activation - - - - - com.sun.xml.ws - jaxws-tools - ${jaxws.tools.version} - - - com.sun.xml.ws - jaxws-rt - ${jaxws.rt.version} - - - org.springframework - spring-core - ${spring.version} - - - org.springframework - spring-beans - ${spring.version} - - - org.springframework - spring-context - ${spring.version} - - - org.springframework - spring-web - ${spring.version} - - - javax.servlet - servlet-api - ${servlet.api.version} - - - org.codehaus.jettison - jettison - ${jettison.version} - - - stax - stax-api - - - - - com.google.code.gson - gson - ${google.gson.version} - - - org.jibx - jibx-bind - ${jibx.version} - - - org.jibx - jibx-run - ${jibx.version} - - - org.codehaus.woodstox - wstx-asl - - - - - org.apache.ant - ant-launcher - ${ant.version} - - - org.apache.ws.commons.axiom - axiom-api - ${axiom.version} - - - xml-apis - xml-apis - - - xerces - xercesImpl - - - - - org.apache.ws.commons.axiom - axiom-impl - ${axiom.version} - - - org.apache.ws.commons.axiom - axiom-dom - ${axiom.version} - - - org.apache.ws.commons.axiom - axiom-jaxb - ${axiom.version} - - - org.apache.ws.commons.axiom - axiom-testutils - ${axiom.version} - - - org.apache.ws.xmlschema - xmlschema-core - ${xmlschema.version} - - - org.apache.neethi - neethi - ${neethi.version} - - - org.codehaus.woodstox - woodstox-core-asl - - - - - org.apache.ant - ant - ${ant.version} - - - commons-logging - commons-logging - ${commons.logging.version} - - - commons-codec - commons-codec - ${commons.codec.version} - - - ${stax.impl.groupid} - ${stax.impl.artifact} - ${stax.impl.version} - - - stax - stax-api - - - - - - org.apache.geronimo.specs - geronimo-stax-api_1.0_spec - ${geronimo.spec.stax.version} - - - org.apache.geronimo.specs - geronimo-activation_1.1_spec - ${geronimo.spec.activation.version} - - - org.apache.geronimo.specs - geronimo-javamail_1.4_spec - ${geronimo.spec.javamail.version} - - - org.apache.geronimo.specs - geronimo-annotation_1.0_spec - ${geronimo.spec.annotation.version} - - - org.apache.geronimo.specs - geronimo-ws-metadata_2.0_spec - ${geronimo.spec.metadata.version} - - - org.apache.geronimo.specs - geronimo-saaj_1.3_spec - ${geronimo.spec.saaj.version} - - - org.apache.geronimo.specs - geronimo-jaxws_2.2_spec - ${geronimo.spec.jaxws.version} - - - - commons-httpclient - commons-httpclient - ${commons.httpclient.version} - - - commons-io - commons-io - ${commons.io.version} - - - org.apache.httpcomponents - httpcore - ${httpcore.version} - - - org.apache.httpcomponents - httpclient - ${httpclient.version} - - - commons-fileupload - commons-fileupload - ${commons.fileupload.version} - - - wsdl4j - wsdl4j - ${wsdl4j.version} - - - org.apache.woden - woden-impl-commons - ${woden.version} - - - org.apache.woden - woden-impl-dom - ${woden.version} - - - javax.ws.rs - jsr311-api - ${jsr311.api.version} - - - xmlunit - xmlunit - ${xmlunit.version} - - - junit - junit - ${junit.version} - - - org.apache.xmlbeans - xmlbeans - ${xmlbeans.version} - - - stax - stax-api - - - - - org.apache.maven - maven-plugin-api - ${maven.version} - - - org.apache.maven - maven-project - ${maven.version} - - - org.apache.maven - maven-artifact - ${maven.artifact.version} - - - org.apache.maven - maven-archiver - ${maven.archiver.version} - - - org.apache.maven - maven-plugin-descriptor - ${maven.plugin.descriptor.version} - - - org.apache.maven.plugins - maven-archetype-plugin - ${maven.archetype.plugin.version} - - - org.codehaus.plexus - plexus-utils - ${plexus.utils.version} - - - org.codehaus.plexus - plexus-classworlds - ${plexus.classworlds.version} - - - org.apache.maven.shared - maven-plugin-testing-harness - test - ${maven.plugin.testing.version} - - - log4j - log4j - ${log4j.version} - - - javax.mail - mail - - - javax.jms - jms - - - com.sun.jdmk - jmxtools - - - com.sun.jmx - jmxri - - - oro - oro - - - junit - junit - - - - - org.eclipse.core - jobs - 3.2.0-v20060603 - - - org.eclipse.core - resources - 3.2.1-R32x_v20060914 - - - org.eclipse.core - runtime - 3.2.0-v20060603 - - - org.eclipse.equinox - common - 3.2.0-v20060603 - - - org.eclipse - jface - 3.2.1-M20060908-1000 - - - org.eclipse - osgi - 3.2.1-R32x_v20060919 - - - org.eclipse - swt - 3.2.1-v3235e - - - org.eclipse.swt.win32.win32 - x86 - 3.2.1-v3235 - - - org.eclipse.ui - ide - 3.2.1-M20060915-1030 - - - org.eclipse.core - expressions - 3.2.1-r321_v20060721 - - - org.eclipse - ui - 3.2.1-M20060913-0800 - - - org.eclipse.ui - workbench - 3.2.1-M20060906-0800 - - - org.eclipse.update - core - 3.2.1-v20092006 - - - com.intellij - openapi - ${intellij.version} - - - com.intellij - extensions - ${intellij.version} - - - rhino - js - ${rhino.version} - - - bsf - bsf - ${bsf.version} - - - jalopy - jalopy - ${jalopy.version} - - - commons-lang - commons-lang - ${commons.lang.version} - - - org.apache.geronimo.specs - geronimo-jta_1.1_spec - ${geronimo-spec.jta.version} - - - - commons-cli - commons-cli - ${commons.cli.version} - - - - - jetty - jetty - 5.1.10 - - - - - org.aspectj - aspectjrt - 1.6.1 - - - org.aspectj - aspectjweaver - 1.6.1 - - - - - - - java16 - - 1.6 - - - - 2.1 - 2.1.7 - 2.1.3 - 2.1.3 - - - - - scm:svn:http://svn.apache.org/repos/asf/axis/axis2/java/core/trunk/modules/parent - scm:svn:https://svn.apache.org/repos/asf/axis/axis2/java/core/trunk/modules/parent - http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/parent - - - - - - maven-antrun-plugin - 1.2 - - - maven-assembly-plugin - - 2.2-beta-5 - - - - 420 - 493 - 493 - - - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.3.1 - - - maven-dependency-plugin - 2.0 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-plugin-plugin - 2.6 - - - maven-rar-plugin - 2.2 - - - maven-resources-plugin - 2.4.2 - - - maven-site-plugin - 2.0-beta-6 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.13 - - - maven-war-plugin - 2.1-beta-1 - - - org.codehaus.mojo - build-helper-maven-plugin - 1.4 - - - org.codehaus.gmaven - gmaven-plugin - 1.2 - - - org.apache.felix - maven-bundle-plugin - 2.1.0 - - - - - org.apache.axis2 - axis2-aar-maven-plugin - 1.5.2 - - - org.apache.axis2 - axis2-mar-maven-plugin - 1.5.2 - - - - - org.apache.axis2 - axis2-repo-maven-plugin - ${project.version} - - - - - - maven-enforcer-plugin - 1.1 - - - validate - - enforce - - - - - The POM must not include repository definitions since non Apache repositories threaten the build stability. - true - true - - true - true - - - - - - - - maven-compiler-plugin - true - - 1.5 - 1.5 - - - - maven-clean-plugin - - false - - - - maven-surefire-plugin - - true - - - - - - - - maven-project-info-reports-plugin - 2.1.1 - - - - - - - - - - From bb97c6fa7ff040b3c3ceea80fc707f34de537870 Mon Sep 17 00:00:00 2001 From: Andreas Veithen Date: Sun, 17 Dec 2017 22:42:11 +0000 Subject: [PATCH 5/5] Use generics. --- .../description/WSDL11ToAxisServiceBuilderTest.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java b/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java index 9e896fe1e6..f8bb920f2e 100644 --- a/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java +++ b/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java @@ -78,19 +78,18 @@ public void testNonDuplicatedElementsHttpBinding() throws Exception { final String portName = "FooHttpGetPort"; AxisService service = new WSDL11ToAxisServiceBuilder(in, serviceName, portName).populateService(); - List schemaDocuments = service.getSchema(); - List duplicatedGlobalElements = findDuplicatedGlobalElements(schemaDocuments); + List schemaDocuments = service.getSchema(); + List duplicatedGlobalElements = findDuplicatedGlobalElements(schemaDocuments); // NO duplicated element should exists assertTrue("Duplicated global element declarations found in '" + wsdlPath, duplicatedGlobalElements.isEmpty()); } - protected List findDuplicatedGlobalElements(List schemaDocuments) { - List duplicatedGlobalElementDeclarations = new ArrayList(); - Set globalElementDeclarations = new HashSet(); + protected List findDuplicatedGlobalElements(List schemaDocuments) { + List duplicatedGlobalElementDeclarations = new ArrayList(); + Set globalElementDeclarations = new HashSet(); // Iterate over all schema documents - for (int i = 0; i < schemaDocuments.size(); i++) { - XmlSchema schemaDocument = (XmlSchema)schemaDocuments.get(i); + for (XmlSchema schemaDocument : schemaDocuments) { for (XmlSchemaObject xmlSchemaObject : schemaDocument.getItems()) { // Check only XML schema elements if (xmlSchemaObject instanceof XmlSchemaElement) {