axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r687924 - in /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws: WSDL2Ws.java WebServiceGeneratorFactory.java info/TypeMap.java
Date Fri, 22 Aug 2008 01:45:28 GMT
Author: nadiramra
Date: Thu Aug 21 18:45:28 2008
New Revision: 687924

URL: http://svn.apache.org/viewvc?rev=687924&view=rev
Log:
Refactor to put code in proper classes.

Modified:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WebServiceGeneratorFactory.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/TypeMap.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=687924&r1=687923&r2=687924&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 Thu Aug 21
18:45:28 2008
@@ -281,8 +281,10 @@
         
         // Generator
         WebServiceGenerator wsg = WebServiceGeneratorFactory.createWebServiceGenerator(wsContext);
-        if (wsg == null)
-            throw new WrapperFault("WSDL2Ws does not support the option combination");
+        
+        // ==================================================
+        // Determine which types to externalize.
+        // ==================================================    
         
         // There must be a better way to do this
         exposeReferenceTypes(wsContext);
@@ -290,16 +292,9 @@
         // This call must be last one called of the exposexxx methods!
         exposeNestedTypesThatAreAnonymousTypes(wsContext);
         
+        // Dump the map if requested.
         if (c_verbose)
-        {
-            System.out.println( "Dumping typeMap....");
-            
-            Iterator it = c_typeMap.getTypes().iterator();
-            while (it.hasNext())
-            {
-                System.out.println(it.next());
-            }
-        }
+            c_typeMap.dump();
         
         // ==================================================
         // Generate the artifacts

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WebServiceGeneratorFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WebServiceGeneratorFactory.java?rev=687924&r1=687923&r2=687924&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WebServiceGeneratorFactory.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WebServiceGeneratorFactory.java
Thu Aug 21 18:45:28 2008
@@ -18,20 +18,22 @@
 package org.apache.axis.wsdl.wsdl2ws;
 
 import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
+
 /**
- * Create the concreate WebService Generator, depends on the options.
+ * Factory for creating concrete Web service generator, depends on the context.
+ * 
  * @author Srinath Perera (hemapani@opensource.lk)
  * @author Dimuthu Leelarathne (muthulee@opensource.lk)
  */
 public class WebServiceGeneratorFactory
 {
-    public static WebServiceGenerator createWebServiceGenerator(WebServiceContext wscontext)
+    public static WebServiceGenerator createWebServiceGenerator(WebServiceContext wscontext)
throws WrapperFault
     {
         if (wscontext.getWrapperInfo().getBindingStyle() == WrapperConstants.STYLE_RPC)
             return new WebServiceGeneratorImpl(wscontext);
         else if (wscontext.getWrapperInfo().getBindingStyle() == WrapperConstants.STYLE_DOCUMENT)
             return new WebServiceGeneratorImpl(wscontext);
-        else
-            return null;
+     
+        throw new WrapperFault("Unable to generate code - Web service generator not found.");
     }
 }

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/TypeMap.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/TypeMap.java?rev=687924&r1=687923&r2=687924&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/TypeMap.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/TypeMap.java Thu Aug
21 18:45:28 2008
@@ -31,7 +31,8 @@
  *
  * e.g.  C++  {urn:ns}classname -> ns:classname
  * 
- * @author hemapani  
+ * @author hemapani 
+ * @author nadir amra (amra@us.ibm.com) 
  */
 public class TypeMap
 {
@@ -146,4 +147,18 @@
         
         return false;
     }    
+    
+    /**
+     * Dump all the types in the collection to stdout.
+     */
+    public void dump()
+    {
+        System.out.println( "Dumping typeMap....");
+        
+        Iterator it = getTypes().iterator();
+        while (it.hasNext())
+        {
+            System.out.println(it.next());
+        }   
+    }
 }



Mime
View raw message