[jbossws-commits] JBossWS SVN: r3805 - in branches/jbossws-2.0: integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant and 3 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Thu Jul 5 16:32:45 EDT 2007


Author: heiko.braun at jboss.com
Date: 2007-07-05 16:32:45 -0400 (Thu, 05 Jul 2007)
New Revision: 3805

Modified:
   branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java
   branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java
   branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/WSConsume.java
   branches/jbossws-2.0/jbossws-core/ant-import-tests/build-testsuite.xml
   branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java
Log:
Add revision switch to jaxws tools. Allows to specify the JAX-WS target specification (2.0|2.1)

Modified: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java	2007-07-05 17:24:44 UTC (rev 3804)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java	2007-07-05 20:32:45 UTC (rev 3805)
@@ -152,6 +152,12 @@
    public abstract void setAdditionalCompilerClassPath(List<String> classPath);
 
    /**
+    * Set the target JAX-WS specification revision. Defaults to <code>2.0</code>
+    * @param version  the JAX-WS specification version. Allowed values are 2.0, 2.1
+    */
+   public abstract void setRevision(String version);
+
+   /**
     * Generate the required artifacts using the specified WSDL URL. This method
     * may be called more than once, although this is probably not desireable
     * 

Modified: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java	2007-07-05 17:24:44 UTC (rev 3804)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java	2007-07-05 20:32:45 UTC (rev 3805)
@@ -49,6 +49,7 @@
  *   <tr><td>wsdlLocation</td><td>Value to use for @@WebService.wsdlLocation</td><td>generated</td></tr>
  *   <tr><td>destdir</td><td>The output directory for generated artifacts.</td><td>"output"</td></tr>
  *   <tr><td>sourcedestdir</td><td>The output directory for Java source.</td><td>value of destdir</td></tr>
+ *   <tr><td>revision</td><td>The JAX-WS specification target</td><td>2.0 | 2.1</td></tr>
  *   <tr><td>verbose</td><td>Enables more informational output about cmd progress.</td><td>false</td><tr>
  *   <tr><td>wsdl*</td><td>The WSDL file or URL</td><td>n/a</td><tr>
  * </table>
@@ -86,6 +87,7 @@
    private boolean verbose = false;
    private boolean fork = false;
    private boolean debug = false;
+   private String revision = null;
    
    // Not actually used right now
    public void setDebug(boolean debug)
@@ -128,6 +130,11 @@
       this.sourcedestdir = sourcedestdir;
    }
 
+   public void setRevision(String revision)
+   {
+      this.revision = revision;
+   }
+
    public void setPackage(String targetPackage)
    {
       this.targetPackage = targetPackage;
@@ -179,6 +186,8 @@
             importer.setCatalog(catalog);
          if (bindingFiles != null && bindingFiles.size() > 0)
             importer.setBindingFiles(bindingFiles);
+         if(revision!=null)
+            importer.setRevision(revision);
          
          log("Consuming wsdl: " + wsdl, Project.MSG_INFO);
          

Modified: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/WSConsume.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/WSConsume.java	2007-07-05 17:24:44 UTC (rev 3804)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/WSConsume.java	2007-07-05 20:32:45 UTC (rev 3805)
@@ -47,6 +47,7 @@
  *  -w  --wsdlLocation=&lt;loc&gt;    Value to use for @@WebService.wsdlLocation
  *  -o, --output=&lt;directory&gt;    The directory to put generated artifacts
  *  -s, --source=&lt;directory&gt;    The directory to put Java source
+ *  -r, --revision=&lt;2.0|2.1&gt;    The target specification target
  *  -q, --quiet                 Be somewhat more quiet
  *  -t, --show-traces           Show full exception stack traces
  *  -l, --load-consumer           Load the consumer and exit (debug utility)
@@ -67,7 +68,8 @@
    private boolean loadConsumer = false;
    private File outputDir = new File("output");
    private File sourceDir = null;
-   
+   private String revision = null;
+
    public static String PROGRAM_NAME = System.getProperty("program.name", WSConsume.class.getName());
 
    public static void main(String[] args)
@@ -79,7 +81,7 @@
    
    private URL parseArguments(String[] args)
    {
-      String shortOpts = "hb:kc:p:w:o:s:qtl";
+      String shortOpts = "hb:kc:p:w:o:sr:qtl";
       LongOpt[] longOpts = 
       {
          new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
@@ -90,6 +92,7 @@
          new LongOpt("wsdlLocation", LongOpt.REQUIRED_ARGUMENT, null, 'w'),
          new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
          new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
+         new LongOpt("revision", LongOpt.NO_ARGUMENT, null, 'r'),
          new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
          new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
          new LongOpt("load-consumer", LongOpt.NO_ARGUMENT, null, 'l'),
@@ -122,6 +125,9 @@
             case 's':
                sourceDir = new File(getopt.getOptarg());
                break;
+            case 'r':
+               revision = getopt.getOptarg();
+               break;
             case 'q':
                quiet = true;
                break;
@@ -201,7 +207,10 @@
       
       if (bindingFiles != null && bindingFiles.size() > 0)
          importer.setBindingFiles(bindingFiles);
-      
+
+      if(revision!=null)
+         importer.setRevision(revision);
+
       try
       {
          importer.consume(wsdl);
@@ -241,6 +250,7 @@
       out.println("    -w  --wsdlLocation=<loc>    Value to use for @WebService.wsdlLocation");
       out.println("    -o, --output=<directory>    The directory to put generated artifacts");
       out.println("    -s, --source=<directory>    The directory to put Java source");
+      out.println("    -r, --revision=<2.0|2.1>    The JAX-WS specification target");
       out.println("    -q, --quiet                 Be somewhat more quiet");
       out.println("    -t, --show-traces           Show full exception stack traces");
       out.println("    -l, --load-consumer         Load the consumer and exit (debug utility)");

Modified: branches/jbossws-2.0/jbossws-core/ant-import-tests/build-testsuite.xml
===================================================================
--- branches/jbossws-2.0/jbossws-core/ant-import-tests/build-testsuite.xml	2007-07-05 17:24:44 UTC (rev 3804)
+++ branches/jbossws-2.0/jbossws-core/ant-import-tests/build-testsuite.xml	2007-07-05 20:32:45 UTC (rev 3805)
@@ -90,7 +90,7 @@
        <classpath location="${core.dir}/thirdparty/wstx.jar"/>
     </taskdef>
 
-    <wsconsume wsdl="${tests.resources.dir}/benchmark/jaxws/doclit/WEB-INF/wsdl/BenchmarkWebService.wsdl" package="org.jboss.test.ws.benchmark.jaxws.doclit" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>
+    <wsconsume wsdl="${tests.resources.dir}/benchmark/jaxws/doclit/WEB-INF/wsdl/BenchmarkWebService.wsdl" package="org.jboss.test.ws.benchmark.jaxws.doclit" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false" revision="2.1"/>
     <wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesDocLitB/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.basedoclitb" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>
     <wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesDocLitW/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.basedoclitw" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>
     <wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesRpcLit/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.baserpclit" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>

Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java	2007-07-05 17:24:44 UTC (rev 3804)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java	2007-07-05 20:32:45 UTC (rev 3805)
@@ -48,6 +48,7 @@
    private PrintStream messageStream;
    private String wsdlLocation;
    private List<String> additionalCompilerClassPath;
+   private String version = "2.0";
 
    @Override
    public void setBindingFiles(List<File> bindingFiles)
@@ -102,6 +103,11 @@
       this.additionalCompilerClassPath = additionalCompilerClassPath;
    }
 
+   public void setRevision(String version)
+   {
+      this.version = version;
+   }
+
    @Override
    public void consume(URL wsdl)
    {
@@ -163,6 +169,11 @@
       // Always add the output directory and the wsdl location
       args.add("-d");
       args.add(outputDir.getAbsolutePath());
+
+      args.add("-target");
+      args.add(version);
+
+      // finally the WSDL file
       args.add(wsdl.toString());
 
       try




More information about the jbossws-commits mailing list