You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by na...@apache.org on 2008/06/27 18:00:38 UTC

svn commit: r672310 - /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java

Author: nadiramra
Date: Fri Jun 27 09:00:37 2008
New Revision: 672310

URL: http://svn.apache.org/viewvc?rev=672310&view=rev
Log:
AXISCPP-458 Incremental update.

Modified:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java?rev=672310&r1=672309&r2=672310&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java Fri Jun 27 09:00:37 2008
@@ -16,6 +16,7 @@
  */
 
 package org.apache.axis.wsdl.wsdl2ws;
+import java.io.File;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
@@ -83,6 +84,7 @@
 
     private String c_language;
     private boolean c_wsdlWrappingStyle;
+    private boolean c_userRequestedWSDLWrappingStyle = false;
     private String c_targetoutputLocation = null;
     private String c_targetEngine = null;
     private String c_targetEndpointURI = null;
@@ -108,10 +110,42 @@
     {
         try
         {
+            // ==================================================
+            // Process the parameters
+            // ==================================================            
+            
             // Verbose mode?
             if (cmdLineArgs.isSet("v"))
                 c_verbose = true;
             
+            // Target location - we resolve to canonical path and use path in completion message later on.
+            c_targetoutputLocation = cmdLineArgs.getOptionBykey("o");
+            if (c_targetoutputLocation == null)
+                c_targetoutputLocation = "." + File.separator;
+            c_targetoutputLocation = (new File(c_targetoutputLocation)).getCanonicalPath();
+            
+            // language c or c++
+            c_language = cmdLineArgs.getOptionBykey("l");
+            if (c_language == null)
+                c_language = "c++";
+            
+            // generate artifacts for server, client or both?
+            c_targetEngine = cmdLineArgs.getOptionBykey("s");
+            if (c_targetEngine == null)
+                c_targetEngine = "server";
+            
+            // Wrapped or unwrapped? The default will be wrapped. 
+            String wsdlWrapStyle = cmdLineArgs.getOptionBykey("w");
+            if (wsdlWrapStyle == null)
+                c_wsdlWrappingStyle = true;
+            else if (wsdlWrapStyle.equalsIgnoreCase("wrapped"))
+            {
+                c_wsdlWrappingStyle = true;
+                c_userRequestedWSDLWrappingStyle = true;
+            }
+            else
+                c_wsdlWrappingStyle = false;            
+            
             // ==================================================
             // Parse the WSDL file
             // ==================================================
@@ -119,13 +153,15 @@
             Parser wsdlParser = new Parser();
             
             // Set verbose in WSDL parser
-            if (c_verbose)
-                wsdlParser.setVerbose(true);
+            wsdlParser.setVerbose(c_verbose);
             
             // Set timeout
             String timeout = cmdLineArgs.getOptionBykey("t"); 
             if (timeout != null) 
                 wsdlParser.setTimeout(Long.parseLong(timeout)); 
+            
+            // Set unwrapped if requested
+            wsdlParser.setNowrap(c_wsdlWrappingStyle == false);
 
             // Parse the WSDL document.
             String wsdlfile = cmdLineArgs.getArgument(0);
@@ -137,32 +173,6 @@
                 c_symbolTable.dump(System.out);
             
             // ==================================================
-            // Process the parameters
-            // ==================================================            
-            
-            // Target location
-            c_targetoutputLocation = cmdLineArgs.getOptionBykey("o");
-            if (c_targetoutputLocation == null)
-                c_targetoutputLocation = "./";
-            
-            // language c or c++
-            c_language = cmdLineArgs.getOptionBykey("l");
-            if (c_language == null)
-                c_language = "c++";
-            
-            // generate artifacts for server, client or both?
-            c_targetEngine = cmdLineArgs.getOptionBykey("s");
-            if (c_targetEngine == null)
-                c_targetEngine = "server";
-            
-            // Wrapped or unwrapped?
-            String wsdlWrapStyle = cmdLineArgs.getOptionBykey("w");
-            if (wsdlWrapStyle == null || wsdlWrapStyle.equalsIgnoreCase("wrapped"))
-                c_wsdlWrappingStyle = true;
-            else
-                c_wsdlWrappingStyle = false;
-
-            // ==================================================
             // Get service definition
             // ==================================================            
                         
@@ -1301,7 +1311,7 @@
             WSDL2Ws gen = new WSDL2Ws(data);
             gen.generateWrappers();
 
-            System.out.println("\nCode generation completed.\n");
+            System.out.println("\nCode generation completed. Generated files in directory '" + gen.getTargetOutputLocation() + "'.");
         }
         catch (Exception e)
         {
@@ -1333,4 +1343,12 @@
         else
             return true;
     }
+
+    /**
+     * @return the c_targetoutputLocation
+     */
+    public String getTargetOutputLocation()
+    {
+        return c_targetoutputLocation;
+    }
 }