axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r551799 - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/databinding/types/ codegen/ codegen/src/org/apache/axis2/wsdl/ codegen/src/org/apache/axis2/wsdl/codegen/ codegen/src/org/apache/axis2/wsdl/codegen/emitter/ codege...
Date Fri, 29 Jun 2007 05:28:53 GMT
Author: amilas
Date: Thu Jun 28 22:28:50 2007
New Revision: 551799

URL: http://svn.apache.org/viewvc?view=rev&rev=551799
Log:
fixed the issues Axis2-2749, Axis2-2831, Axis2-2872

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Union.java
    webservices/axis2/trunk/java/modules/codegen/pom.xml
    webservices/axis2/trunk/java/modules/codegen/project.xml
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/FileWriter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/XSLTIncludeResolver.java
    webservices/axis2/trunk/java/modules/integration/itest-build.xml
    webservices/axis2/trunk/java/modules/integration/maven.xml
    webservices/axis2/trunk/java/modules/integration/pom.xml
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAllAxisServicesBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Union.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Union.java?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Union.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Union.java
Thu Jun 28 22:28:50 2007
@@ -21,6 +21,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import java.math.BigDecimal;
 
 
 /** this class is the super class of all the union simple types */
@@ -72,8 +73,7 @@
             } else {
                 setObject(new QName(value));
             }
-
-        } else if ("datetime".equals(type)) {
+        } else if ("dateTime".equals(type)) {
             setObject(ConverterUtil.convertToDateTime(value));
         } else if ("time".equals(type)) {
             setObject(ConverterUtil.convertToTime(value));
@@ -81,8 +81,26 @@
             setObject(new Float(value));
         } else if ("long".equals(type)) {
             setObject(new Long(value));
-        } else if ("dobule".equals(type)) {
+        } else if ("double".equals(type)) {
             setObject(new Double(value));
+        } else if ("decimal".equals(type)) {
+            setObject(new BigDecimal(value));
+        } else if ("unsignedLong".equals(type)) {
+            setObject(new UnsignedLong(value));
+        } else if ("unsignedInt".equals(type)) {
+            setObject(new UnsignedInt(value));
+        } else if ("unsignedShort".equals(type)) {
+            setObject(new UnsignedShort(value));
+        } else if ("unsignedByte".equals(type)) {
+            setObject(new UnsignedByte(value));
+        } else if ("positiveInteger".equals(type)) {
+            setObject(new PositiveInteger(value));
+        } else if ("negativeInteger".equals(type)) {
+            setObject(new NegativeInteger(value));
+        } else if ("nonNegativeInteger".equals(type)) {
+            setObject(new NonNegativeInteger(value));
+        } else if ("nonPositiveInteger".equals(type)) {
+            setObject(new NonPositiveInteger(value));
         } else {
             throw new RuntimeException("Object not found");
         }

Modified: webservices/axis2/trunk/java/modules/codegen/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/pom.xml?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/pom.xml (original)
+++ webservices/axis2/trunk/java/modules/codegen/pom.xml Thu Jun 28 22:28:50 2007
@@ -65,5 +65,37 @@
 				</excludes>
 			</resource>
 		</resources>
-	</build>
+        <testResources>
+            <testResource>
+                <directory>test</directory>
+                <includes>
+                    <include>**/*.xsl</include>
+                </includes>
+            </testResource>
+            <testResource>
+                <directory>../adb-codegen/src</directory>
+                <includes>
+                    <include>**/*.xsl</include>
+                </includes>
+            </testResource>
+            <testResource>
+                <directory>../xmlbeans/src</directory>
+                <includes>
+                    <include>**/*.xsl</include>
+                </includes>
+            </testResource>
+            <testResource>
+                <directory>../jaxbri/src</directory>
+                <includes>
+                    <include>**/*.xsl</include>
+                </includes>
+            </testResource>
+            <testResource>
+                <directory>../jibx/src</directory>
+                <includes>
+                    <include>**/*.xsl</include>
+                </includes>
+            </testResource>
+        </testResources>
+    </build>
 </project>

Modified: webservices/axis2/trunk/java/modules/codegen/project.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/project.xml?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/project.xml (original)
+++ webservices/axis2/trunk/java/modules/codegen/project.xml Thu Jun 28 22:28:50 2007
@@ -226,13 +226,47 @@
                 </includes>
             </resource>
             <resource>
-        <directory>../../</directory>
-        <targetPath>META-INF</targetPath>
-        <includes>
-          <include>NOTICE.txt</include>
-        <include>LICENSE.txt</include>
-      </includes>
-   </resource>
+                <directory>../../</directory>
+                <targetPath>META-INF</targetPath>
+                <includes>
+                    <include>NOTICE.txt</include>
+                    <include>LICENSE.txt</include>
+                </includes>
+            </resource>
         </resources>
+        <unitTest>
+            <resources>
+                <resource>
+                    <directory>test</directory>
+                    <includes>
+                        <include>**/*.xsl</include>
+                    </includes>
+                </resource>
+                <resource>
+                    <directory>../adb-codegen/src</directory>
+                    <includes>
+                        <include>**/*.xsl</include>
+                    </includes>
+                </resource>
+                <resource>
+                    <directory>../xmlbeans/src</directory>
+                    <includes>
+                        <include>**/*.xsl</include>
+                    </includes>
+                </resource>
+                <resource>
+                    <directory>../jaxbri/src</directory>
+                    <includes>
+                        <include>**/*.xsl</include>
+                    </includes>
+                </resource>
+                <resource>
+                    <directory>../jibx/src</directory>
+                    <includes>
+                        <include>**/*.xsl</include>
+                    </includes>
+                </resource>
+            </resources>
+        </unitTest>
     </build>
 </project>

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
Thu Jun 28 22:28:50 2007
@@ -59,6 +59,8 @@
         System.out.println(CodegenMessages.getMessage("wsdl2code.arg22"));
         System.out.println(CodegenMessages.getMessage("wsdl2code.arg23"));
         System.out.println(CodegenMessages.getMessage("wsdl2code.arg24"));
+        System.out.println(CodegenMessages.getMessage("wsdl2code.arg24"));
+        System.out.println(CodegenMessages.getMessage("wsdl2code.arg24"));
 
         System.exit(0);
     }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
Thu Jun 28 22:28:50 2007
@@ -532,4 +532,23 @@
     public void setWsdlDefinition(Definition wsdlDefinition) {
         this.wsdlDefinition = wsdlDefinition;
     }
+
+    private boolean isAllPorts;
+    private boolean isOverride;
+
+    public boolean isAllPorts() {
+        return isAllPorts;
+    }
+
+    public void setAllPorts(boolean allPorts) {
+        isAllPorts = allPorts;
+    }
+
+    public boolean isOverride() {
+        return isOverride;
+    }
+
+    public void setOverride(boolean override) {
+        isOverride = override;
+    }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
Thu Jun 28 22:28:50 2007
@@ -122,12 +122,14 @@
                     builder = new WSDL11ToAxisServiceBuilder(
                             wsdl4jDef,
                             serviceQname,
-                            configuration.getPortName());
+                            configuration.getPortName(),
+                            configuration.isAllPorts());
                     builder.setCodegen(true);
                     configuration.addAxisService(builder.populateService());
                 } else {
-                    builder = new WSDL11ToAllAxisServicesBuilder(wsdl4jDef);
+                    builder = new WSDL11ToAllAxisServicesBuilder(wsdl4jDef, configuration.getPortName());
                     builder.setCodegen(true);
+                    builder.setAllPorts(configuration.isAllPorts());
                     configuration.setAxisServices(
                             ((WSDL11ToAllAxisServicesBuilder)builder).populateAllServices());
                 }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
Thu Jun 28 22:28:50 2007
@@ -253,6 +253,15 @@
             config.setXsdConfigFile(commandLineOption.getOptionValue());
         }
 
+        // setting the overrid and all ports options
+        config.setAllPorts(loadOption(WSDL2JavaConstants.All_PORTS_OPTION,
+                                      WSDL2JavaConstants.All_PORTS_OPTION_LONG,
+                                      optionMap) != null);
+
+        config.setOverride(loadOption(WSDL2JavaConstants.OVERRIDE_OPTION,
+                                      WSDL2JavaConstants.OVERRIDE_OPTION_LONG,
+                                      optionMap) != null);
+
         // loop through the map and find parameters having the extra prefix.
         //put them in the property map
         Iterator keyIterator = optionMap.keySet().iterator();

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
Thu Jun 28 22:28:50 2007
@@ -549,6 +549,7 @@
                 codeGenConfiguration.getOutputLanguage());
 
         antBuildWriter.setDatabindingFramework(codeGenConfiguration.getDatabindingType());
+        antBuildWriter.setOverride(codeGenConfiguration.isOverride());
         writeFile(skeletonModel, antBuildWriter);
     }
 
@@ -603,7 +604,7 @@
                                     getOutputDirectory(codeGenConfiguration.getOutputLocation(),
                                             TEST_SRC_DIR_NAME),
                             codeGenConfiguration.getOutputLanguage());
-
+            callbackWriter.setOverride(codeGenConfiguration.isOverride());
             writeFile(classModel, callbackWriter);
         }
     }
@@ -698,7 +699,7 @@
                                         codeGenConfiguration.getSourceLocation()),
                         codeGenConfiguration.getOutputLanguage());
 
-
+        writer.setOverride(codeGenConfiguration.isOverride());
         writeFile(interfaceImplModel, writer);
 
 
@@ -1057,7 +1058,7 @@
             //////////////////////////////////////////////////////////
 //            System.out.println(DOM2Writer.nodeToString(doc));
             ////////////////////////////////////////////////////////////
-
+            exceptionWriter.setOverride(codeGenConfiguration.isOverride());
             writeFile(doc, exceptionWriter);
         }
     }
@@ -1097,7 +1098,7 @@
                                     getOutputDirectory(codeGenConfiguration.getOutputLocation(),
                                             codeGenConfiguration.getSourceLocation()),
                             codeGenConfiguration.getOutputLanguage());
-
+            callbackWriter.setOverride(codeGenConfiguration.isOverride());
             writeFile(interfaceModel, callbackWriter);
         }
     }
@@ -1142,7 +1143,7 @@
                                 getOutputDirectory(codeGenConfiguration.getOutputLocation(),
                                         codeGenConfiguration.getSourceLocation()),
                         this.codeGenConfiguration.getOutputLanguage());
-
+        interfaceWriter.setOverride(codeGenConfiguration.isOverride());
         writeFile(interfaceModel, interfaceWriter);
     }
 
@@ -1464,8 +1465,9 @@
                                                 codeGenConfiguration.getOutputLocation(),
                                                 codeGenConfiguration.getSourceLocation()),
                                 codeGenConfiguration.getOutputLanguage());
-
+                writer.setOverride(codeGenConfiguration.isOverride());
                 writeFile(classModel, writer);
+
             }
         }
     }
@@ -1858,7 +1860,7 @@
                                 getOutputDirectory(codeGenConfiguration.getOutputLocation(),
                                         codeGenConfiguration.getResourceLocation()),
                         this.codeGenConfiguration.getOutputLanguage());
-
+        serviceXmlWriter.setOverride(codeGenConfiguration.isOverride());
         writeFile(serviceXMLModel, serviceXmlWriter);
 
     }
@@ -1939,7 +1941,7 @@
                         getOutputDirectory(codeGenConfiguration.getOutputLocation(),
                                 codeGenConfiguration.getSourceLocation())
                 , this.codeGenConfiguration.getOutputLanguage());
-
+        skeletonWriter.setOverride(codeGenConfiguration.isOverride());
         writeFile(skeletonModel, skeletonWriter);
     }
 
@@ -1957,7 +1959,7 @@
                         getOutputDirectory(codeGenConfiguration.getOutputLocation(),
                                 codeGenConfiguration.getSourceLocation())
                 , this.codeGenConfiguration.getOutputLanguage());
-
+        skeletonInterfaceWriter.setOverride(codeGenConfiguration.isOverride());
         writeFile(skeletonModel, skeletonInterfaceWriter);
     }
 

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/FileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/FileWriter.java?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/FileWriter.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/FileWriter.java
Thu Jun 28 22:28:50 2007
@@ -47,6 +47,7 @@
     protected static final String SEPARATOR_STRING = ",";
 
     protected boolean fileExists = false;//a flag saying the file is existing
+    protected boolean isOverride = false;
 
     /**
      * Sets the language.
@@ -122,12 +123,17 @@
                                                 fileName,
                                                 getFileExtensionForLanguage(language));
         //set the existing flag
-        fileExists = outputFile.exists();
-        if (!fileExists) {
+        if (this.isOverride) {
             this.stream = new FileOutputStream(outputFile);
         } else {
-            log.info(Messages.getMessage("fileExistsNoOverwrite", outputFile.toString()));
+            fileExists = outputFile.exists();
+            if (!fileExists) {
+                this.stream = new FileOutputStream(outputFile);
+            } else {
+                log.info(Messages.getMessage("fileExistsNoOverwrite", outputFile.toString()));
+            }
         }
+
     }
 
     /**
@@ -170,5 +176,13 @@
             this.stream.flush();
             this.stream.close();
         }
+    }
+
+    public boolean isOverride() {
+        return isOverride;
+    }
+
+    public void setOverride(boolean override) {
+        isOverride = override;
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
Thu Jun 28 22:28:50 2007
@@ -38,6 +38,8 @@
 wsdl2code.arg22=\t  -f                      Flattens the generated files
 wsdl2code.arg23=\t  -uw                      Switch on un-wrapping.
 wsdl2code.arg24=\t  -xsdconfig <path to file> Use XMLBeans .xsdconfig file. Valid only
with -d xmlbeans.
+wsdl2code.arg25=\t  -ap <all-ports> generate code for all ports
+wsdl2code.arg26=\t  -or <over-ride> override the existing classes
 #wsdl2code.arg19=\t  -b                       Generate Axis 1.x backword compatible code.
 
 ################## prop file loader #################################

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
Thu Jun 28 22:28:50 2007
@@ -131,6 +131,14 @@
                             (WSDL2JavaConstants.NO_WSDLS_OPTION_LONG)
                                     .equalsIgnoreCase(optionType) ||
                             (WSDL2JavaConstants.NO_BUILD_XML_OPTION_LONG)
+                                    .equalsIgnoreCase(optionType) ||
+                            (WSDL2JavaConstants.All_PORTS_OPTION)
+                                    .equalsIgnoreCase(optionType) ||
+                            (WSDL2JavaConstants.All_PORTS_OPTION_LONG)
+                                    .equalsIgnoreCase(optionType) ||
+                            (WSDL2JavaConstants.OVERRIDE_OPTION)
+                                    .equalsIgnoreCase(optionType) ||
+                            (WSDL2JavaConstants.OVERRIDE_OPTION_LONG)
                                     .equalsIgnoreCase(optionType)
                     );
 

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/XSLTIncludeResolver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/XSLTIncludeResolver.java?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/XSLTIncludeResolver.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/XSLTIncludeResolver.java
Thu Jun 28 22:28:50 2007
@@ -31,6 +31,8 @@
 
     private CodeGenConfiguration configuration;
 
+    public static final String EMPTY_TEMPLATE = "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"/>";
+
     public XSLTIncludeResolver() {
     }
 
@@ -77,7 +79,11 @@
                 return new StreamSource(supporterTemplateStream);
             }
         } else if ((href != null) && (!href.equals("externalTemplate"))){
-            return getSourceFromTemplateName(href);
+            Source source = getSourceFromTemplateName(href);
+            if ((source != null) && ((StreamSource)source).getInputStream() != null){
+                return source;
+            }
+            return getEmptySource();
         }
         //if nothing could be found return an empty source
         return getEmptySource();
@@ -107,7 +113,6 @@
      * @return stream source
      */
     private Source getEmptySource() {
-        return new StreamSource(new ByteArrayInputStream(
-                "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"/>".getBytes()));
+        return new StreamSource(new ByteArrayInputStream(EMPTY_TEMPLATE.getBytes()));
     }
 }

Modified: webservices/axis2/trunk/java/modules/integration/itest-build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/itest-build.xml?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/itest-build.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/itest-build.xml Thu Jun 28 22:28:50 2007
@@ -4,7 +4,7 @@
 		<echo>Running codegen RPC WSDLs - take 1</echo>
 		<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 			<classpath refid="maven.dependency.classpath"/>
-			<arg line="-o target/rpc-test1 -uri test-resources/rpc/test-rpc-2.wsdl -uw"/>
+			<arg line="-ap -o target/rpc-test1 -uri test-resources/rpc/test-rpc-2.wsdl -uw"/>
 		</java>
 		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/rpc-test1"
 							 target="jar.client"/>
@@ -12,7 +12,7 @@
 		<echo>Running codegen RPC WSDLs - take 2</echo>
 		<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 			<classpath refid="maven.dependency.classpath"/>
-			<arg line="-o target/rpc-test2 -uri test-resources/rpc/test-rpc-3.wsdl -uw"/>
+			<arg line="-ap -o target/rpc-test2 -uri test-resources/rpc/test-rpc-3.wsdl -uw"/>
 		</java>
 		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/rpc-test2"
 							 target="jar.client"/>
@@ -21,7 +21,7 @@
 		<echo>Running codegen RPC WSDLs - take 3</echo>
 		<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 			<classpath refid="maven.dependency.classpath"/>
-			<arg line="-o target/rpc-test3 -uri test-resources/rpc/test-rpc-2.wsdl -uw"/>
+			<arg line="-ap -o target/rpc-test3 -uri test-resources/rpc/test-rpc-2.wsdl -uw"/>
 		</java>
 		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/rpc-test3"
 							 target="jar.client"/>
@@ -29,7 +29,7 @@
 		<echo>Running codegen RPC WSDLs - take 4</echo>
 		<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 			<classpath refid="maven.dependency.classpath"/>
-			<arg line="-o target/rpc-test4 -uri test-resources/rpc/test-rpc-2.wsdl -uw -ss -sd"/>
+			<arg line="-ap -o target/rpc-test4 -uri test-resources/rpc/test-rpc-2.wsdl -uw -ss
-sd"/>
 		</java>
 		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/rpc-test4"
 							 target="jar.server"/>
@@ -37,7 +37,7 @@
 		<echo>Running codegen RPC WSDLs with helper mode -  take 1</echo>
 		<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 			<classpath refid="maven.dependency.classpath"/>
-			<arg line="-o target/helper-test1 -uri test-resources/rpc/test-rpc-2.wsdl -u -Eh"/>
+			<arg line="-ap -o target/helper-test1 -uri test-resources/rpc/test-rpc-2.wsdl -u -Eh"/>
 		</java>
 		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/helper-test1"
 					 target="jar.client"/>
@@ -45,7 +45,7 @@
 		<echo>Running codegen RPC WSDLs with helper mode -  take 2</echo>
 		<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 			<classpath refid="maven.dependency.classpath"/>
-			<arg line="-o target/helper-test2 -uri test-resources/rpc/test-rpc-2.wsdl -u -Eh"/>
+			<arg line="-ap -o target/helper-test2 -uri test-resources/rpc/test-rpc-2.wsdl -u -Eh"/>
 		</java>
 		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/helper-test2"
 					 target="jar.client"/>
@@ -56,7 +56,7 @@
 		<echo>Running codegen for Enterprise WSDL - take 1</echo>
 		<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 			<classpath refid="maven.dependency.classpath"/>
-			<arg line="-d xmlbeans -o target/enterprise-test1 -s -uri test-resources/enterprise.wsdl"/>
+			<arg line="-ap -d xmlbeans -o target/enterprise-test1 -s -uri test-resources/enterprise.wsdl"/>
 		</java>
 		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/enterprise-test1"
 									 target="jar.client"/>
@@ -64,7 +64,7 @@
 		<echo>Running codegen for Enterprise WSDL - take 2</echo>
 		<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 			<classpath refid="maven.dependency.classpath"/>
-			<arg line="-o target/enterprise-test2 -s -uri test-resources/enterprise.wsdl"/>
+			<arg line="-ap -o target/enterprise-test2 -s -uri test-resources/enterprise.wsdl"/>
 		</java>
 		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/enterprise-test2"
 									 target="jar.client"/>
@@ -72,7 +72,7 @@
 		<echo>Running codegen for Enterprise WSDL - take 3</echo>
 		<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 			<classpath refid="maven.dependency.classpath"/>
-			<arg line="-d xmlbeans -ss -sd -g -o target/enterprise-test3 -s -uri test-resources/enterprise.wsdl"/>
+			<arg line="-ap -d xmlbeans -ss -sd -g -o target/enterprise-test3 -s -uri test-resources/enterprise.wsdl"/>
 		</java>
 		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/enterprise-test3"
 									 target="jar.server"/>
@@ -80,7 +80,7 @@
 		<echo>Running codegen for Enterprise WSDL - take 4</echo>
 		<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 			<classpath refid="maven.dependency.classpath"/>
-			<arg line="-ns2p urn:sobject.enterprise.soap.sforce.com=com.salesforce -d xmlbeans
-ss -sd -g -o target/enterprise-test4 -s -uri test-resources/enterprise.wsdl"/>
+			<arg line="-ap -ns2p urn:sobject.enterprise.soap.sforce.com=com.salesforce -d xmlbeans
-ss -sd -g -o target/enterprise-test4 -s -uri test-resources/enterprise.wsdl"/>
 		</java>
 		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/enterprise-test4"
 									 target="jar.server"/>
@@ -88,7 +88,7 @@
 		<echo>Running codegen for eBaySvc WSDL</echo>
 		<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 			<classpath refid="maven.dependency.classpath"/>
-			<arg line="-ss -sd -g -u -ssi -t -o target/eBaySvc -uri test-resources/eBaySvc.wsdl"/>
+			<arg line="-ap -ss -sd -g -u -ssi -t -o target/eBaySvc -uri test-resources/eBaySvc.wsdl"/>
 		</java>
 		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/eBaySvc"
 									 target="jar.server"/>
@@ -96,7 +96,7 @@
 		<echo>Running codegen for eBaySvc WSDL Back word compatibiliy</echo>
 		<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 			<classpath refid="maven.dependency.classpath"/>
-			<arg line="-ss -sd -g -t -u -ssi -b -s -o target/eBaySvcB -uri test-resources/eBaySvc.wsdl"/>
+			<arg line="-ap -ss -sd -g -t -u -ssi -b -s -o target/eBaySvcB -uri test-resources/eBaySvc.wsdl"/>
 		</java>
 		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/eBaySvcB"
 									 target="jar.server"/>
@@ -104,7 +104,7 @@
 		<echo>Running codegen for eBaySvc WSDL with un wrapping </echo>
 		<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 			<classpath refid="maven.dependency.classpath"/>
-			<arg line="-ss -sd -ssi -u -g -t -uw  -o target/eBaySvcUW -uri test-resources/eBaySvc.wsdl"/>
+			<arg line="-ap -ss -sd -ssi -u -g -t -uw  -o target/eBaySvcUW -uri test-resources/eBaySvc.wsdl"/>
 		</java>
 		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/eBaySvcUW"
 									 target="jar.server"/>

Modified: webservices/axis2/trunk/java/modules/integration/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/maven.xml?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/maven.xml Thu Jun 28 22:28:50 2007
@@ -30,7 +30,7 @@
             <jvmarg line="${maven.junit.jvmargs}"/>
             <classpath refid="maven.dependency.classpath"/>
             <classpath location="${compiled.classes.dir}"/>
-            <arg line="-o target/wsdl/complexdatatype -s -u -uw -uri test-resources/ComplexDataTypes/ComplexDataTypes.wsdl"/>
+            <arg line="-o target/wsdl/complexdatatype -ap -s -u -uw -uri test-resources/ComplexDataTypes/ComplexDataTypes.wsdl"/>
         </java>
         <javac destdir="target/classes" debug="on">
             <jvmarg line="${maven.junit.jvmargs}"/>
@@ -46,7 +46,7 @@
             <jvmarg line="${maven.junit.jvmargs}"/>
             <classpath refid="maven.dependency.classpath"/>
             <classpath location="${compiled.classes.dir}"/>
-            <arg line="-o target/wsdl/complexdatatypebare -s -uri test-resources/ComplexDataTypesDocLitBare/ComplexDataTypesDocLitBare.wsdl"/>
+            <arg line="-o target/wsdl/complexdatatypebare -ap -s -uri test-resources/ComplexDataTypesDocLitBare/ComplexDataTypesDocLitBare.wsdl"/>
         </java>
         <javac destdir="target/classes" debug="on">
             <jvmarg line="${maven.junit.jvmargs}"/>
@@ -63,7 +63,7 @@
             <jvmarg line="${maven.junit.jvmargs}"/>
             <classpath refid="maven.dependency.classpath"/>
             <classpath location="${compiled.classes.dir}"/>
-            <arg line="-o target/wsdl/documentunwrapping -ss -sd -ssi -u  -g -uw -uri
test-resources/wsdl/DocumentUnwrappingTest.wsdl"/>
+            <arg line="-o target/wsdl/documentunwrapping -ap -ss -sd -ssi -u  -g -uw -uri
test-resources/wsdl/DocumentUnwrappingTest.wsdl"/>
         </java>
         <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/wsdl/documentunwrapping"/>
 
@@ -74,7 +74,7 @@
             <jvmarg line="${maven.junit.jvmargs}"/>
             <classpath refid="maven.dependency.classpath"/>
             <classpath location="${compiled.classes.dir}"/>
-            <arg line="-o target/wsdl/rpcunwrapping -ss -sd -ssi -u  -g -uw -uri test-resources/wsdl/RPCUnwrappingTest.wsdl"/>
+            <arg line="-o target/wsdl/rpcunwrapping -ap -ss -sd -ssi -u  -g -uw -uri test-resources/wsdl/RPCUnwrappingTest.wsdl"/>
         </java>
         <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/wsdl/rpcunwrapping"/>
 

Modified: webservices/axis2/trunk/java/modules/integration/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/pom.xml?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/pom.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/pom.xml Thu Jun 28 22:28:50 2007
@@ -443,7 +443,7 @@
 								<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 									<classpath refid="maven.runtime.classpath"/>
 									<classpath location="${compiled.classes.dir}"/>
-									<arg line="-o target/wsdl/complexdatatype -s -u -uw -uri test-resources/ComplexDataTypes/ComplexDataTypes.wsdl"/>
+									<arg line="-ap -o target/wsdl/complexdatatype -s -u -uw -uri test-resources/ComplexDataTypes/ComplexDataTypes.wsdl"/>
 								</java>
 								<javac fork="true" destdir="target/classes" debug="on">
 									<classpath refid="maven.runtime.classpath"/>
@@ -457,7 +457,7 @@
                                 <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                     <classpath refid="maven.runtime.classpath"/>
                                     <classpath location="${compiled.classes.dir}"/>
-                                    <arg line="-o target/wsdl/documentunwrapping -ss -sd
-ssi -u  -g -uw -uri test-resources/wsdl/DocumentUnwrappingTest.wsdl"/>
+                                    <arg line="-ap -o target/wsdl/documentunwrapping -ss
-sd -ssi -u  -g -uw -uri test-resources/wsdl/DocumentUnwrappingTest.wsdl"/>
                                 </java>
                                 <ant antfile="build.xml" inheritall="true" inheritrefs="true"
                                      dir="target/wsdl/documentunwrapping"/>
@@ -468,7 +468,7 @@
 
                                     <classpath refid="maven.runtime.classpath"/>
                                     <classpath location="${compiled.classes.dir}"/>
-                                    <arg line="-o target/wsdl/rpcunwrapping -ss -sd -ssi
-u  -g -uw -uri test-resources/wsdl/RPCUnwrappingTest.wsdl"/>
+                                    <arg line="-ap -o target/wsdl/rpcunwrapping -ss -sd
-ssi -u  -g -uw -uri test-resources/wsdl/RPCUnwrappingTest.wsdl"/>
                                 </java>
                                 <ant antfile="build.xml" inheritall="true" inheritrefs="true"
                                      dir="target/wsdl/rpcunwrapping"/>
@@ -478,7 +478,7 @@
 								<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
 									<classpath refid="maven.runtime.classpath"/>
 									<classpath location="${compiled.classes.dir}"/>
-									<arg line="-o target/wsdl/complexdatatypebare -s -uri test-resources/ComplexDataTypesDocLitBare/ComplexDataTypesDocLitBare.wsdl"/>
+									<arg line="-ap -o target/wsdl/complexdatatypebare -s -uri test-resources/ComplexDataTypesDocLitBare/ComplexDataTypesDocLitBare.wsdl"/>
 								</java>
                                 <ant antfile="build.xml" inheritall="true" inheritrefs="true"
                                      dir="target/wsdl/complexdatatypebare"/>
@@ -579,4 +579,4 @@
       </plugin>
     </plugins>
     </reporting>
-</project>
\ No newline at end of file
+</project>

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAllAxisServicesBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAllAxisServicesBuilder.java?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAllAxisServicesBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAllAxisServicesBuilder.java
Thu Jun 28 22:28:50 2007
@@ -60,6 +60,11 @@
         axisServices = new ArrayList();   // create an empty ArrayList
     }
 
+     public WSDL11ToAllAxisServicesBuilder(Definition def, String portName) {
+        super(def, null, portName);
+        axisServices = new ArrayList();   // create an empty ArrayList
+    }
+
 
     /**
      * Public method to access the wsdl 1.1 file and create a List of AxisService objects.
@@ -88,8 +93,11 @@
 
             if (wsdl4jDefinition.getServices().size() > 0) {
                 Iterator wsdlServIter = wsdl4jDefinition.getServices().values().iterator();
-                // let the wsdlToservice builder to decide the port to generate binding
-                portName = null;
+                if (wsdl4jDefinition.getServices().size() > 1){
+                     // let the wsdlToservice builder to decide the port to generate binding
+                     portName = null;
+                } 
+
                 while (wsdlServIter.hasNext()) {
                     Service service = (Service) wsdlServIter.next();
                     // set the serviceName on the parent to setup call to populateService

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?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- 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
Thu Jun 28 22:28:50 2007
@@ -165,6 +165,8 @@
     // As bindings are processed add it to this array so that we dont process the same binding
twice
     private Map processedBindings;
 
+    private boolean isAllPorts;
+
     /**
      * constructor taking in the service name and the port name
      *
@@ -188,9 +190,25 @@
         super(null, serviceName);
         this.wsdl4jDefinition = def;
         this.portName = portName;
+        this.isAllPorts = false;
     }
 
     /**
+     * @param def
+     * @param serviceName
+     * @param portName
+     */
+    public WSDL11ToAxisServiceBuilder(Definition def,
+                                      QName serviceName,
+                                      String portName,
+                                      boolean isAllPorts) {
+        this(def,serviceName,portName);
+        this.isAllPorts = isAllPorts;
+    }
+
+
+
+    /**
      * @param in
      * @param service
      */
@@ -244,6 +262,8 @@
             Service wsdl4jService = findService(wsdl4jDefinition);
             Binding binding = findBinding(wsdl4jDefinition, wsdl4jService);
 
+
+
             if (binding.getPortType() == null) {
                 throw new AxisFault("There is no port type associated with the binding");
             }
@@ -703,14 +723,13 @@
             // i.e if user has specified a service
             port = service.getPort(portName);
             if (port == null) {
-                throw new AxisFault("No port found for the given name :"
-                        + portName);
+                throw new AxisFault("No port found for the given name :" + portName);
             }
         } else {
             Map ports = service.getPorts();
             if (ports != null && ports.size() > 0) {
                 // pick the port with the SOAP address as the default port
-                port = findSOAPPort(ports);
+                port = findPort(ports);
                 if (port == null) {
                     // a SOAP port was not found - log a warning
                     // and use the first port in the list
@@ -718,6 +737,15 @@
                             + "picking a random port!");
                     port = (Port) ports.values().toArray()[0];
                 }
+
+                if (port != null){
+                    // i.e we have find a correct port
+                    if (!this.isAllPorts){
+                        // if user has not set all option
+                        // we have to generate code only for that option.
+                        this.portName = port.getName();
+                    }
+                }
             }
         }
 
@@ -738,10 +766,22 @@
     /**
      * Finds a SOAP port given the port map
      *
-     * @param ports
+     * @param pHttpAddressHttpAddressorts
      */
-    private Port findSOAPPort(Map ports) {
+    private Port findPort(Map ports) {
         Port port;
+        for (Iterator portsIterator = ports.values().iterator(); portsIterator.hasNext();)
{
+            port = (Port) portsIterator.next();
+            List extensibilityElements = port.getExtensibilityElements();
+            for (int i = 0; i < extensibilityElements.size(); i++) {
+                Object extElement = extensibilityElements.get(i);
+                if (extElement instanceof SOAP12Address) {
+                    // SOAP 1.2 address found - return that port and we are done
+                    return port;
+                }
+            }
+        }
+
         for (Iterator portsIterator = ports.values().iterator(); portsIterator
                 .hasNext();) {
             port = (Port) portsIterator.next();
@@ -752,9 +792,17 @@
                     // SOAP 1.1 address found - return that port and we are done
                     return port;
                 }
+            }
+        }
 
-                if (extElement instanceof SOAP12Address) {
-                    // SOAP 1.2 address found - return that port and we are done
+        for (Iterator portsIterator = ports.values().iterator(); portsIterator
+                .hasNext();) {
+            port = (Port) portsIterator.next();
+            List extensibilityElements = port.getExtensibilityElements();
+            for (int i = 0; i < extensibilityElements.size(); i++) {
+                Object extElement = extensibilityElements.get(i);
+                if (extElement instanceof HTTPAddress) {
+                    // SOAP 1.1 address found - return that port and we are done
                     return port;
                 }
             }
@@ -2429,7 +2477,15 @@
         }
 
     }
-    
+
+    public boolean isAllPorts() {
+        return isAllPorts;
+    }
+
+    public void setAllPorts(boolean allPorts) {
+        isAllPorts = allPorts;
+    }
+
 //    private void processPoliciesInDefinition() {
 //        
 //        Object obj;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java?view=diff&rev=551799&r1=551798&r2=551799
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java
Thu Jun 28 22:28:50 2007
@@ -47,6 +47,8 @@
         String SOURCE_FOLDER_NAME_OPTION = "S";
         String RESOURCE_FOLDER_OPTION = "R";
         String XSDCONFIG_OPTION = "xc";
+        String All_PORTS_OPTION = "ap";
+        String OVERRIDE_OPTION = "or";
 
         //long option constants
         String OUTPUT_LOCATION_OPTION_LONG = "output";
@@ -76,6 +78,8 @@
         String SOURCE_FOLDER_NAME_OPTION_LONG = "source-folder";
         String RESOURCE_FOLDER_OPTION_LONG = "resource-folder";
         String XSDCONFIG_OPTION_LONG = "xsdconfig";
+        String All_PORTS_OPTION_LONG = "all-ports";
+        String OVERRIDE_OPTION_LONG = "over-ride";
 
         String WSDL_VERSION_2 = "2.0";
         String WSDL_VERSION_2_OPTIONAL = "2";



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message