cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r489592 [1/2] - in /incubator/cxf/trunk: rt/core/src/main/java/org/apache/cxf/wsdl11/ tools/common/src/main/java/org/apache/cxf/tools/common/ tools/common/src/main/java/org/apache/cxf/tools/util/ tools/common/src/test/java/org/apache/cxf/to...
Date Fri, 22 Dec 2006 09:44:32 GMT
Author: mmao
Date: Fri Dec 22 01:44:31 2006
New Revision: 489592

URL: http://svn.apache.org/viewvc?view=rev&rev=489592
Log:
CXF-222 Tooling Refactoring

* Add validation before customize the wsdl11 definition
* Refactoring WSDLToProcessor,
  it only contain the velocity stuff, moved the wsdl parsing to WsdlDefinitionBuilder and validating/customiztion to WSDLToJavaContainer
* Refactoring WSDLToJavaProcessor, 
  it only build the javamodel from servicemodel, move the compile out to ClassUtils, 
* WSDLToJavaContainer build only one service, instead of a list of service

Added:
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java   (with props)
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/Compiler.java
      - copied, changed from r489301, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/compiler/Compiler.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/StreamPrinter.java
      - copied, changed from r489301, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/compiler/StreamPrinter.java
    incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/ToolContextTest.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/WSDLToProcessor.java
      - copied, changed from r489301, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java
      - copied, changed from r489301, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java
Removed:
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/compiler/Compiler.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/compiler/StreamPrinter.java
Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java
    incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/AbstractProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/core/pom.xml
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractWSDLBuilder.java
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/FrontEndProfile.java
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java Fri Dec 22 01:44:31 2006
@@ -75,6 +75,7 @@
             wsdlReader = wsdlFactory.newWSDLReader();
             // TODO enable the verbose if in verbose mode.
             wsdlReader.setFeature("javax.wsdl.verbose", false);
+            wsdlReader.setExtensionRegistry(registry);
             
             // REVIST: URIResolve is to solve the wsdl import and schema import, 
             //         but seems it works fine now without URIResolver
@@ -85,7 +86,7 @@
             //wsdlURL = resolver.getURI().toString();
             //wsdlDefinition = wsdlReader.readWSDL(new WSDLResolver(wsdlURL, insource));
             WSDLLocatorImpl wsdlLocator = new WSDLLocatorImpl(wsdlURL);
-            wsdlDefinition = wsdlReader.readWSDL(wsdlLocator);
+            wsdlDefinition = wsdlReader.readWSDL(wsdlLocator);            
 
             parseImports(wsdlDefinition);
         } catch (Exception we) {
@@ -131,8 +132,6 @@
                 if (LOG.isLoggable(Level.FINE)) {
                     LOG.fine("Registering extension: " + elementType + " for parent: " + parentType);
                 }
-                System.err.println("parent type: " + parentType);
-                System.err.println("elementType : " + elementType);
                 JAXBExtensionHelper.addExtensions(registry, parentType, elementType, getClass()
                                 .getClassLoader());
             } catch (ClassNotFoundException ex) {

Added: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java?view=auto&rev=489592
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java (added)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java Fri Dec 22 01:44:31 2006
@@ -0,0 +1,158 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.common;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.tools.util.ClassCollector;
+import org.apache.cxf.tools.util.Compiler;
+
+public class ClassUtils {
+    
+    protected static final Logger LOG = LogUtils.getL7dLogger(ClassUtils.class);
+    
+    public void compile(ToolContext context) throws ToolException {        
+        List<String> argList = new ArrayList<String>();
+        
+        String javaClasspath = System.getProperty("java.class.path");
+        // hard code cxf.jar
+        boolean classpathSetted = javaClasspath != null ? true : false;
+        // && (javaClasspath.indexOf("cxf.jar") >= 0);
+        if (context.isVerbose()) {
+            argList.add("-verbose");
+        }
+
+        if (context.get(ToolConstants.CFG_CLASSDIR) != null) {
+            argList.add("-d");
+            String classDir = (String)context.get(ToolConstants.CFG_CLASSDIR);
+            argList.add(classDir.replace(File.pathSeparatorChar, '/'));
+        }
+
+        if (!classpathSetted) {
+            argList.add("-extdirs");
+            argList.add(getClass().getClassLoader().getResource(".").getFile() + "../lib/");
+        } else {
+            argList.add("-classpath");
+            argList.add(javaClasspath);
+        }
+
+        String outPutDir = (String)context.get(ToolConstants.CFG_OUTPUTDIR);
+       
+        Set<String> dirSet = new HashSet<String>();
+        ClassCollector classCollector = context.get(ClassCollector.class);
+        List<String> fileList = new ArrayList<String>();
+        Iterator ite = classCollector.getGeneratedFileInfo().iterator();
+        while (ite.hasNext()) {
+            String fileName = (String)ite.next();
+            fileName = fileName.replace('.', File.separatorChar);
+            String dirName = fileName.substring(0, fileName.lastIndexOf(File.separator) + 1);
+            
+            String path = outPutDir + File.separator + dirName;
+            if (!dirSet.contains(path)) {
+
+                dirSet.add(path);
+                File file = new File(path);
+                if (file.isDirectory()) {
+                    for (String str : file.list()) {
+                        if (str.endsWith("java")) {
+                            fileList.add(path + str);
+                        } else {
+                            // copy generated xml file or others to class directory
+                            File otherFile = new File(path + File.separator + str);
+                            if (otherFile.isFile() && str.toLowerCase().endsWith("xml")
+                                && context.get(ToolConstants.CFG_CLASSDIR) != null) {
+                                String targetDir = (String)context.get(ToolConstants.CFG_CLASSDIR);
+
+                                File targetFile = new File(targetDir + File.separator + dirName
+                                                           + File.separator + str);
+                                copyXmlFile(otherFile, targetFile);
+                            }
+                        }
+                    }
+                }
+            }
+
+        }
+        //Jaxb's bug . Jaxb ClassNameCollecotr may not be invoked when generated class is an enum.
+        //So we need recheck whether we add all generated source files to  fileList
+        
+        String[] arguments = new String[argList.size() + fileList.size() + 1];
+        arguments[0] = "javac";
+        
+        int i = 1;
+        
+        for (Object obj : argList.toArray()) {
+            String arg = (String)obj;
+            arguments[i] = arg;
+            i++;
+        }
+        
+        int srcFileIndex = i; 
+        
+        for (Object o : fileList.toArray()) {
+            String file = (String)o;
+            arguments[i] = file;
+            i++;
+        }
+
+        Compiler compiler = new Compiler();
+
+        if (!compiler.internalCompile(arguments, srcFileIndex)) {
+            Message msg = new Message("FAIL_TO_COMPILE_GENERATE_CODES", LOG);
+            throw new ToolException(msg);
+        }        
+    }
+    
+    private void copyXmlFile(File from, File to) throws ToolException {
+
+        try {
+            String dir = to.getCanonicalPath()
+                .substring(0, to.getCanonicalPath().lastIndexOf(File.separator));
+            File dirFile = new File(dir);
+            dirFile.mkdirs();
+            FileInputStream input = new FileInputStream(from);
+            FileOutputStream output = new FileOutputStream(to);
+            byte[] b = new byte[1024 * 3];
+            int len = 0;
+            while (len != -1) {
+                len = input.read(b);
+                if (len != -1) {
+                    output.write(b, 0, len);
+                }
+            }
+            output.flush();
+            output.close();
+            input.close();
+        } catch (Exception e) {
+            Message msg = new Message("FAIL_TO_COPY_GENERATED_RESOURCE_FILE", LOG);
+            throw new ToolException(msg, e);
+        }
+    }    
+}

Propchange: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java Fri Dec 22 01:44:31 2006
@@ -125,7 +125,6 @@
     public static final String SERVICE_GENERATOR = "service.generator";
     public static final String ANT_GENERATOR = "ant.generator";
     public static final String HANDLER_GENERATOR = "handler.generator";
-    public static final String GENERATED_CLASS_COLLECTOR = "generatedClassCollector";
 
     // Binding namespace
     public static final String NS_JAXWS_BINDINGS = "http://java.sun.com/xml/ns/jaxws";

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java Fri Dec 22 01:44:31 2006
@@ -23,6 +23,7 @@
 import java.util.*;
 
 import javax.wsdl.extensions.schema.Schema;
+import javax.xml.namespace.QName;
 
 import org.xml.sax.InputSource;
 
@@ -40,11 +41,10 @@
     private final Map<String, InputSource> jaxbBindingFiles = new HashMap<String, InputSource>();
     private List<String> excludePkgList = new java.util.ArrayList<String>();
     private List<String> excludeFileList = new java.util.ArrayList<String>();
-   
+
     public ToolContext() {
     }
 
-
     public void loadDefaultNS2Pck(InputStream ins) {
         try {
             PropertyUtil properties = new PropertyUtil();
@@ -80,7 +80,7 @@
             }
         }
     }
-    
+
     public void setParameters(Map<String, Object> map) {
         this.paramMap = map;
     }
@@ -104,10 +104,10 @@
     public <T> T get(Class<T> key) {
         return key.cast(get(key.getName()));
     }
-    
+
     public <T> void put(Class<T> key, T value) {
         put(key.getName(), value);
-    } 
+    }
 
     public boolean getBooleanValue(String key, String defaultValue) {
         return Boolean.valueOf((String)get(key, defaultValue)).booleanValue();
@@ -139,6 +139,7 @@
         }
     }
 
+    // REVIST: Prefer using optionSet, to keep the context clean
     public boolean validateWSDL() {
         return get(ToolConstants.CFG_VALIDATE_WSDL) != null;
 
@@ -199,20 +200,37 @@
     public boolean isExcludeNamespaceEnabled() {
         return excludeNamespacePackageMap.size() > 0;
     }
-    
+
     @SuppressWarnings("unchecked")
     public List<Schema> getSchemaList() {
         return (List<Schema>)this.get(ToolConstants.SCHEMA_LIST);
     }
-    
+
     public List<String> getExcludePkgList() {
         return this.excludePkgList;
     }
-    
+
     public List<String> getExcludeFileList() {
         return this.excludeFileList;
     }
     
-    
-    
+    public QName getQName(String key) {
+        return getQName(key, null);
+    }
+
+    public QName getQName(String key, String defaultNamespace) {
+        if (optionSet(key)) {
+            String pns = (String)get(key);
+            int pos = pns.indexOf("=");
+            String localname = pns;
+            if (pos != -1) {
+                String ns = pns.substring(0, pos);
+                localname = pns.substring(pos + 1);
+                return new QName(ns, localname);
+            } else {
+                return new QName(defaultNamespace, localname);
+            }
+        }
+        return null;
+    }
 }

Copied: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/Compiler.java (from r489301, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/compiler/Compiler.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/Compiler.java?view=diff&rev=489592&p1=incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/compiler/Compiler.java&r1=489301&p2=incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/Compiler.java&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/compiler/Compiler.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/Compiler.java Fri Dec 22 01:44:31 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.wsdl2java.processor.compiler;
+package org.apache.cxf.tools.util;
 
 import java.io.File;
 import java.io.FileWriter;

Copied: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/StreamPrinter.java (from r489301, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/compiler/StreamPrinter.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/StreamPrinter.java?view=diff&rev=489592&p1=incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/compiler/StreamPrinter.java&r1=489301&p2=incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/StreamPrinter.java&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/compiler/StreamPrinter.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/StreamPrinter.java Fri Dec 22 01:44:31 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.wsdl2java.processor.compiler;
+package org.apache.cxf.tools.util;
 
 import java.io.BufferedReader;
 import java.io.IOException;

Added: incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/ToolContextTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/ToolContextTest.java?view=auto&rev=489592
==============================================================================
--- incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/ToolContextTest.java (added)
+++ incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/ToolContextTest.java Fri Dec 22 01:44:31 2006
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.common;
+
+import java.util.HashMap;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+public class ToolContextTest extends TestCase {
+
+    ToolContext context = new ToolContext();
+    
+    public void setUp() {        
+        context.setParameters(new HashMap<String, Object>());
+    }
+    
+    public void testGetQName() throws Exception {
+        assertNull(context.getQName(ToolConstants.CFG_SERVICENAME));
+        
+        context.put(ToolConstants.CFG_SERVICENAME, "SoapService");
+        QName qname = context.getQName(ToolConstants.CFG_SERVICENAME);        
+        assertEquals(new QName(null, "SoapService"), qname);
+        
+        qname = context.getQName(ToolConstants.CFG_SERVICENAME, "http://cxf.org");
+        assertEquals(new QName("http://cxf.org", "SoapService"), qname);
+        
+        context.put(ToolConstants.CFG_SERVICENAME, "http://apache.org=SoapService");
+        qname = context.getQName(ToolConstants.CFG_SERVICENAME);
+        assertEquals(new QName("http://apache.org", "SoapService"), qname);
+    }
+}

Propchange: incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/ToolContextTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/ToolContextTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java (original)
+++ incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java Fri Dec 22 01:44:31 2006
@@ -57,7 +57,7 @@
     }
 
     public boolean isValid() throws ToolException {
-        boolean isValid = true;
+        //boolean isValid = true;
         String schemaDir = getSchemaDir();
         SchemaValidator schemaValidator = null;
         String[] schemas = (String[])env.get(ToolConstants.CFG_SCHEMA_URL);
@@ -79,8 +79,7 @@
 
         }
         if (!schemaValidator.isValid()) {
-            this.addErrorMessage(schemaValidator.getErrorMessage());
-            isValid = false;
+            this.addErrorMessage(schemaValidator.getErrorMessage());            
             throw new ToolException(this.getErrorMessage());
 
         } else {
@@ -94,13 +93,11 @@
 
         for (AbstractValidator validator : validators) {
             if (!validator.isValid()) {
-                addErrorMessage(validator.getErrorMessage());
-                isValid = false;
+                addErrorMessage(validator.getErrorMessage());                
                 throw new ToolException(this.getErrorMessage());
             }
         }
-
-        return isValid;
+        return true;
     }
 
     public String getSchemaDir() {

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java Fri Dec 22 01:44:31 2006
@@ -77,8 +77,8 @@
     public void initialize(ToolContext penv) throws ToolException {
         env = penv;
 
-        SchemaCompilerImpl schemaCompiler = (SchemaCompilerImpl)XJC.createSchemaCompiler();
-        ClassCollector classCollector = (ClassCollector)env.get(ToolConstants.GENERATED_CLASS_COLLECTOR);
+        SchemaCompilerImpl schemaCompiler = (SchemaCompilerImpl)XJC.createSchemaCompiler();        
+        ClassCollector classCollector = env.get(ClassCollector.class);
 
         ClassNameAllocatorImpl allocator = new ClassNameAllocatorImpl(classCollector);
 
@@ -183,7 +183,7 @@
     }
     
     private boolean addedToClassCollector(String packageName) {
-        ClassCollector classCollector = (ClassCollector)env.get(ToolConstants.GENERATED_CLASS_COLLECTOR);
+        ClassCollector classCollector = env.get(ClassCollector.class);
         List<String> files = (List<String>)classCollector.getGeneratedFileInfo();
         for (String file : files) {
             int dotIndex = file.lastIndexOf(".");

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java Fri Dec 22 01:44:31 2006
@@ -111,7 +111,7 @@
     }
 
     protected Writer parseOutputName(String packageName, String filename) throws ToolException {
-        ClassCollector collector = (ClassCollector)env.get(ToolConstants.GENERATED_CLASS_COLLECTOR);
+        ClassCollector collector = env.get(ClassCollector.class);
         
         if (ToolConstants.SEI_GENERATOR.equals(name)) {
             collector.addSeiClassName(packageName , filename , packageName + "." + filename);

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java Fri Dec 22 01:44:31 2006
@@ -20,30 +20,24 @@
 package org.apache.cxf.tools.wsdl2java.processor;
 
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import javax.wsdl.Definition;
 import javax.wsdl.PortType;
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.tools.common.ClassUtils;
 import org.apache.cxf.tools.common.FrontEndGeneratorsProfile;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.extensions.jaxws.CustomizationParser;
 import org.apache.cxf.tools.common.extensions.jaxws.JAXWSBinding;
 import org.apache.cxf.tools.common.model.JavaModel;
-import org.apache.cxf.tools.util.ClassCollector;
 import org.apache.cxf.tools.wsdl2java.frontend.jaxws.JAXWSProfile;
-import org.apache.cxf.tools.wsdl2java.processor.compiler.Compiler;
 import org.apache.cxf.tools.wsdl2java.processor.internal.PortTypeProcessor;
 import org.apache.cxf.tools.wsdl2java.processor.internal.SEIAnnotationProcessor;
 import org.apache.cxf.tools.wsdl2java.processor.internal.ServiceProcessor;
@@ -61,7 +55,8 @@
         doGeneration();
 
         if (env.get(ToolConstants.CFG_COMPILE) != null) {
-            compile();
+            new ClassUtils().compile(env);
+            //compile();
         }
         try {
             if (env.isExcludeNamespaceEnabled()) {
@@ -72,25 +67,6 @@
         }
     }
 
-    public void processImportDefinition(Definition def) throws ToolException {
-        checkSupported(def);
-        validateWSDL(def);
-        parseCustomization(def);
-        env.put(ToolConstants.GENERATED_CLASS_COLLECTOR, classColletor);
-
-        //Generate client, server and service stub code for specified profile
-        registerGenerators();
-        doGeneration();
-
-        try {
-            if (env.isExcludeNamespaceEnabled()) {
-                removeExcludeFiles();
-            }
-        } catch (IOException e) {
-            throw new ToolException(e);
-        }
-    }
-
     public void removeExcludeFiles() throws IOException {
         excludeGenFiles = env.getExcludeFileList();
         if (excludeGenFiles == null) {
@@ -230,122 +206,122 @@
         return binding;
     }
 
-    private void compile() throws ToolException {
-        ClassCollector classCollector = (ClassCollector)env.get(ToolConstants.GENERATED_CLASS_COLLECTOR);
-        List<String> argList = new ArrayList<String>();
-        List<String> fileList = new ArrayList<String>();
-
-        String javaClasspath = System.getProperty("java.class.path");
-        // hard code cxf.jar
-        boolean classpathSetted = javaClasspath != null ? true : false;
-        // && (javaClasspath.indexOf("cxf.jar") >= 0);
-        if (env.isVerbose()) {
-            argList.add("-verbose");
-        }
-
-        if (env.get(ToolConstants.CFG_CLASSDIR) != null) {
-            argList.add("-d");
-            argList.add(((String)env.get(ToolConstants.CFG_CLASSDIR)).replace(File.pathSeparatorChar, '/'));
-        }
-
-        if (!classpathSetted) {
-            argList.add("-extdirs");
-            argList.add(getClass().getClassLoader().getResource(".").getFile() + "../lib/");
-        } else {
-            argList.add("-classpath");
-            argList.add(javaClasspath);
-        }
-
-        String outPutDir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
-       
-        Set<String> dirSet = new HashSet<String>();
-        Iterator ite = classCollector.getGeneratedFileInfo().iterator();
-        while (ite.hasNext()) {
-            String fileName = (String)ite.next();
-            fileName = fileName.replace('.', File.separatorChar);
-            String dirName = fileName.substring(0, fileName.lastIndexOf(File.separator) + 1);
-            
-            String path = outPutDir + File.separator + dirName;
-            if (!dirSet.contains(path)) {
-
-                dirSet.add(path);
-                File file = new File(path);
-                if (file.isDirectory()) {
-                    for (String str : file.list()) {
-                        if (str.endsWith("java")) {
-                            fileList.add(path + str);
-                        } else {
-                            // copy generated xml file or others to class
-                            // directory
-                            File otherFile = new File(path + File.separator + str);
-                            if (otherFile.isFile() && str.toLowerCase().endsWith("xml")
-                                && env.get(ToolConstants.CFG_CLASSDIR) != null) {
-                                String targetDir = (String)env.get(ToolConstants.CFG_CLASSDIR);
-
-                                File targetFile = new File(targetDir + File.separator + dirName
-                                                           + File.separator + str);
-                                copyXmlFile(otherFile, targetFile);
-                            }
-                        }
-                    }
-                }
-            }
-
-        }
-        //Jaxb's bug . Jaxb ClassNameCollecotr may not be invoked when generated class is an enum.
-        //So we need recheck whether we add all generated source files to  fileList
-        
-        String[] arguments = new String[argList.size() + fileList.size() + 1];
-        arguments[0] = "javac";
-        
-        int i = 1;
-        
-        for (Object obj : argList.toArray()) {
-            String arg = (String)obj;
-            arguments[i] = arg;
-            i++;
-        }
-        
-        int srcFileIndex = i; 
-        
-        for (Object o : fileList.toArray()) {
-            String file = (String)o;
-            arguments[i] = file;
-            i++;
-        }
-
-        Compiler compiler = new Compiler();
-
-        if (!compiler.internalCompile(arguments, srcFileIndex)) {
-            Message msg = new Message("FAIL_TO_COMPILE_GENERATE_CODES", LOG);
-            throw new ToolException(msg);
-        }
-
-    }
-
-    private void copyXmlFile(File from, File to) throws ToolException {
-
-        try {
-            String dir = to.getCanonicalPath()
-                .substring(0, to.getCanonicalPath().lastIndexOf(File.separator));
-            File dirFile = new File(dir);
-            dirFile.mkdirs();
-            FileInputStream input = new FileInputStream(from);
-            FileOutputStream output = new FileOutputStream(to);
-            byte[] b = new byte[1024 * 3];
-            int len = 0;
-            while (len != -1) {
-                len = input.read(b);
-                if (len != -1) {
-                    output.write(b, 0, len);
-                }
-            }
-            output.flush();
-            output.close();
-            input.close();
-        } catch (Exception e) {
-            Message msg = new Message("FAIL_TO_COPY_GENERATED_RESOURCE_FILE", LOG);
-            throw new ToolException(msg, e);
-        }
-    }
+//    private void compile() throws ToolException {
+//        ClassCollector classCollector = (ClassCollector)env.get(ToolConstants.GENERATED_CLASS_COLLECTOR);
+//        List<String> argList = new ArrayList<String>();
+//        List<String> fileList = new ArrayList<String>();
+//
+//        String javaClasspath = System.getProperty("java.class.path");
+//        // hard code cxf.jar
+//        boolean classpathSetted = javaClasspath != null ? true : false;
+//        // && (javaClasspath.indexOf("cxf.jar") >= 0);
+//        if (env.isVerbose()) {
+//            argList.add("-verbose");
+//        }
+//
+//        if (env.get(ToolConstants.CFG_CLASSDIR) != null) {
+//            argList.add("-d");
+//            argList.add(((String)env.get(ToolConstants.CFG_CLASSDIR)).replace(File.pathSeparatorChar, '/'));
+//        }
+//
+//        if (!classpathSetted) {
+//            argList.add("-extdirs");
+//            argList.add(getClass().getClassLoader().getResource(".").getFile() + "../lib/");
+//        } else {
+//            argList.add("-classpath");
+//            argList.add(javaClasspath);
+//        }
+//
+//        String outPutDir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
+//       
+//        Set<String> dirSet = new HashSet<String>();
+//        Iterator ite = classCollector.getGeneratedFileInfo().iterator();
+//        while (ite.hasNext()) {
+//            String fileName = (String)ite.next();
+//            fileName = fileName.replace('.', File.separatorChar);
+//            String dirName = fileName.substring(0, fileName.lastIndexOf(File.separator) + 1);
+//            
+//            String path = outPutDir + File.separator + dirName;
+//            if (!dirSet.contains(path)) {
+//
+//                dirSet.add(path);
+//                File file = new File(path);
+//                if (file.isDirectory()) {
+//                    for (String str : file.list()) {
+//                        if (str.endsWith("java")) {
+//                            fileList.add(path + str);
+//                        } else {
+//                            // copy generated xml file or others to class
+//                            // directory
+//                            File otherFile = new File(path + File.separator + str);
+//                            if (otherFile.isFile() && str.toLowerCase().endsWith("xml")
+//                                && env.get(ToolConstants.CFG_CLASSDIR) != null) {
+//                                String targetDir = (String)env.get(ToolConstants.CFG_CLASSDIR);
+//
+//                                File targetFile = new File(targetDir + File.separator + dirName
+//                                                           + File.separator + str);
+//                                copyXmlFile(otherFile, targetFile);
+//                            }
+//                        }
+//                    }
+//                }
+//            }
+//
+//        }
+//        //Jaxb's bug . Jaxb ClassNameCollecotr may not be invoked when generated class is an enum.
+//        //So we need recheck whether we add all generated source files to  fileList
+//        
+//        String[] arguments = new String[argList.size() + fileList.size() + 1];
+//        arguments[0] = "javac";
+//        
+//        int i = 1;
+//        
+//        for (Object obj : argList.toArray()) {
+//            String arg = (String)obj;
+//            arguments[i] = arg;
+//            i++;
+//        }
+//        
+//        int srcFileIndex = i; 
+//        
+//        for (Object o : fileList.toArray()) {
+//            String file = (String)o;
+//            arguments[i] = file;
+//            i++;
+//        }
+//
+//        Compiler compiler = new Compiler();
+//
+//        if (!compiler.internalCompile(arguments, srcFileIndex)) {
+//            Message msg = new Message("FAIL_TO_COMPILE_GENERATE_CODES", LOG);
+//            throw new ToolException(msg);
+//        }
+//
+//    }
+//
+//    private void copyXmlFile(File from, File to) throws ToolException {
+//
+//        try {
+//            String dir = to.getCanonicalPath()
+//                .substring(0, to.getCanonicalPath().lastIndexOf(File.separator));
+//            File dirFile = new File(dir);
+//            dirFile.mkdirs();
+//            FileInputStream input = new FileInputStream(from);
+//            FileOutputStream output = new FileOutputStream(to);
+//            byte[] b = new byte[1024 * 3];
+//            int len = 0;
+//            while (len != -1) {
+//                len = input.read(b);
+//                if (len != -1) {
+//                    output.write(b, 0, len);
+//                }
+//            }
+//            output.flush();
+//            output.close();
+//            input.close();
+//        } catch (Exception e) {
+//            Message msg = new Message("FAIL_TO_COPY_GENERATED_RESOURCE_FILE", LOG);
+//            throw new ToolException(msg, e);
+//        }
+//    }
 }

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java Fri Dec 22 01:44:31 2006
@@ -362,8 +362,7 @@
         validateWSDL(getWSDLDefinition());
         parseCustomization(getWSDLDefinition());
         initVelocity();
-        classColletor = new ClassCollector();
-        env.put(ToolConstants.GENERATED_CLASS_COLLECTOR, classColletor);
+        env.put(ClassCollector.class, new ClassCollector());
         initDataModel();
 
     }

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/AbstractProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/AbstractProcessor.java?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/AbstractProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/AbstractProcessor.java Fri Dec 22 01:44:31 2006
@@ -37,7 +37,7 @@
     
     public AbstractProcessor(ToolContext penv) {
         this.env = penv;
-        this.collector = (ClassCollector)env.get(ToolConstants.GENERATED_CLASS_COLLECTOR);
+        this.collector = env.get(ClassCollector.class);
         dataBinder = (DataBindingGenerator)env.get(ToolConstants.BINDING_GENERATOR);
         
     }

Modified: incubator/cxf/trunk/tools2/wsdlto/core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/pom.xml?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/pom.xml (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/pom.xml Fri Dec 22 01:44:31 2006
@@ -22,7 +22,7 @@
     <artifactId>cxf-tools2-wsdlto-core</artifactId>
     <packaging>jar</packaging>
     <version>2.0-incubator-RC-SNAPSHOT</version>
-    <name>Apache CXF Command Line Tools2 WSDLTo</name>
+    <name>Apache CXF Command Line Tools2 WSDLTo Core</name>
     <url>http://cwiki.apache.org/confluence/display/CXF/Index</url>
 
     <parent>

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java Fri Dec 22 01:44:31 2006
@@ -20,18 +20,24 @@
 package org.apache.cxf.tools.wsdlto;
 
 import java.io.File;
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Properties;
 import java.util.Set;
-
 import javax.wsdl.Definition;
+import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactoryHelper;
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.common.AbstractCXFToolContainer;
+import org.apache.cxf.tools.common.ClassUtils;
+import org.apache.cxf.tools.common.FrontEndGenerator;
 import org.apache.cxf.tools.common.Processor;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
@@ -41,6 +47,7 @@
 import org.apache.cxf.tools.common.toolspec.parser.CommandDocument;
 import org.apache.cxf.tools.common.toolspec.parser.ErrorVisitor;
 import org.apache.cxf.tools.wsdlto.core.AbstractWSDLBuilder;
+import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
 import org.apache.cxf.tools.wsdlto.core.FrontEndProfile;
 import org.apache.cxf.wsdl11.WSDLServiceBuilder;
 
@@ -80,31 +87,51 @@
                 FrontEndProfile frontend = context.get(FrontEndProfile.class);
                 
                 Processor processor = frontend.getProcessor();
-
-                AbstractWSDLBuilder builder = frontend.getWSDLBuilder();
                 
                 ToolConstants.WSDLVersion version = getWSDLVersion();
 
-                //List<ServiceInfo> services;
+                ServiceInfo service = null;
                 String wsdlURL = (String)context.get(ToolConstants.CFG_WSDLURL);
+                
+                // Build the ServiceModel from the WSDLModel
                 if (version == ToolConstants.WSDLVersion.WSDL11) {
-                    Definition definition = (Definition) builder.build(wsdlURL);
+                    AbstractWSDLBuilder<Definition> builder =
+                        (AbstractWSDLBuilder<Definition>) frontend.getWSDLBuilder();
+                    Definition definition = builder.build(wsdlURL);
+                    builder.validate(definition);
                     
                     if (context.optionSet(ToolConstants.CFG_BINDING)) {
                         builder.setContext(context);
                         builder.customize();
                     }
+
                     WSDLServiceBuilder serviceBuilder = new WSDLServiceBuilder(getBus());
-                    //services =
-                    serviceBuilder.buildService(definition);
+                    service = serviceBuilder.buildService(definition, getServiceQName(definition));
                 } else {
                     // TODO: wsdl2.0 support
                 }
-                
+
+                // Generate types
+                generateTypes();                
+
+                // Build the JavaModel from the ServiceModel
+                context.put(ServiceInfo.class, service);
                 processor.setEnvironment(context);
-                // TODO: replace the wsdl4j with service model
-                //processor.setServiceModel(services);
                 processor.process();
+
+                // Generate artifacts
+                for (FrontEndGenerator generator : frontend.getGenerators()) {
+                    generator.generate(context);
+                }
+
+                // Build projects: compile classes and copy resources etc.
+                if (context.optionSet(ToolConstants.CFG_COMPILE)) {
+                    new ClassUtils().compile(context);
+                }
+
+                if (context.isExcludeNamespaceEnabled()) {
+                    removeExcludeFiles();
+                }
             }
         } catch (ToolException ex) {
             if (ex.getCause() instanceof BadUsageException) {
@@ -122,7 +149,25 @@
             }
         }
     }
-    
+
+    @SuppressWarnings("unchecked")    
+    private QName getServiceQName(Definition definition) {
+        QName qname = context.getQName(ToolConstants.CFG_SERVICENAME);
+        if (qname == null) {
+            qname = (QName) definition.getServices().keySet().iterator().next();
+        }
+        if (StringUtils.isEmpty(qname.getNamespaceURI())) {
+            for (Iterator<QName> ite = definition.getServices().keySet().iterator(); ite.hasNext();) {
+                QName qn = ite.next();
+                if (qn.getLocalPart().equals(qname.getLocalPart())) {
+                    return qn;
+                }
+            }
+            qname = new QName(definition.getTargetNamespace(), qname.getLocalPart());
+        }
+        return qname;
+    }
+
     private void loadDefaultNSPackageMapping(ToolContext env) {
         if (!env.hasExcludeNamespace(DEFAULT_NS2PACKAGE) 
             && env.getBooleanValue(ToolConstants.CFG_DEFAULT_NS, "true")) {
@@ -255,6 +300,63 @@
             Message msg = new Message("PARAMETER_MISSING", LOG);
             throw new ToolException(msg, new BadUsageException(getUsage(), errors));
         }
-    }    
+    }
+
+    private void removeExcludeFiles() throws IOException {
+        List<String> excludeGenFiles = context.getExcludeFileList();
+        if (excludeGenFiles == null) {
+            return;
+        }
+        String outPutDir = (String)context.get(ToolConstants.CFG_OUTPUTDIR);
+        for (int i = 0; i < excludeGenFiles.size(); i++) {
+            String excludeFile = excludeGenFiles.get(i);
+            File file = new File(outPutDir, excludeFile);
+            file.delete();
+            File tmpFile = file.getParentFile();
+            while (tmpFile != null && !tmpFile.getCanonicalPath().equalsIgnoreCase(outPutDir)) {
+                if (tmpFile.isDirectory() && tmpFile.list().length == 0) {
+                    tmpFile.delete();
+                }
+                tmpFile = tmpFile.getParentFile();
+            }
+
+            if (context.get(ToolConstants.CFG_COMPILE) != null) {
+                String classDir = context.get(ToolConstants.CFG_CLASSDIR) == null
+                    ? outPutDir : (String)context.get(ToolConstants.CFG_CLASSDIR);
+                File classFile = new File(classDir, excludeFile.substring(0, excludeFile.indexOf(".java"))
+                                                    + ".class");
+                classFile.delete();
+                File tmpClzFile = classFile.getParentFile();
+                while (tmpClzFile != null && !tmpClzFile.getCanonicalPath().equalsIgnoreCase(outPutDir)) {
+                    if (tmpClzFile.isDirectory() && tmpClzFile.list().length == 0) {
+                        tmpClzFile.delete();
+                    }
+                    tmpClzFile = tmpClzFile.getParentFile();
+                }
+            }
+        }
+    }
+
+    public boolean passthrough() {
+        if (context.optionSet(ToolConstants.CFG_GEN_TYPES)
+            || context.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        }
+        if (context.optionSet(ToolConstants.CFG_GEN_ANT)
+            || context.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || context.optionSet(ToolConstants.CFG_GEN_IMPL)
+            || context.optionSet(ToolConstants.CFG_GEN_SEI)
+            || context.optionSet(ToolConstants.CFG_GEN_SERVER)
+            || context.optionSet(ToolConstants.CFG_GEN_SERVICE)) {
+            return true;
+        }
+        return false;
+    }
     
+    private void generateTypes() throws ToolException {
+        if (passthrough()) {
+            return;
+        }
+        context.get(DataBindingProfile.class).generate();
+    }
 }

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractWSDLBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractWSDLBuilder.java?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractWSDLBuilder.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractWSDLBuilder.java Fri Dec 22 01:44:31 2006
@@ -20,6 +20,7 @@
 package org.apache.cxf.tools.wsdlto.core;
 
 import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.wsdl.WSDLBuilder;
 
 public abstract class AbstractWSDLBuilder<T> implements WSDLBuilder<T> {
@@ -30,4 +31,6 @@
     }
     
     public abstract void customize();
+
+    public abstract boolean validate(T t) throws ToolException;
 }

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/FrontEndProfile.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/FrontEndProfile.java?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/FrontEndProfile.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/FrontEndProfile.java Fri Dec 22 01:44:31 2006
@@ -29,7 +29,7 @@
     Processor processor;
     Class containerClz;
     String toolspec;
-    AbstractWSDLBuilder builder;
+    AbstractWSDLBuilder<? extends Object> builder;
 
     public void setContainerClass(Class c) {
         this.containerClz = c;
@@ -63,11 +63,11 @@
         this.processor = prs;
     }
 
-    public void setWSDLBuilder(AbstractWSDLBuilder b) {
+    public void setWSDLBuilder(AbstractWSDLBuilder<? extends Object> b) {
         this.builder = b;
     }
 
-    public AbstractWSDLBuilder getWSDLBuilder() {
+    public AbstractWSDLBuilder<? extends Object> getWSDLBuilder() {
         return builder;
     }
 

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java Fri Dec 22 01:44:31 2006
@@ -242,10 +242,10 @@
         return "/" + getContainerPackage(frontend).replace(".", "/") + "/" + toolspec;
     }
 
-    private AbstractWSDLBuilder loadBuilder(String fullClzName) {
-        AbstractWSDLBuilder builder = null;
+    private AbstractWSDLBuilder<? extends Object> loadBuilder(String fullClzName) {
+        AbstractWSDLBuilder<? extends Object> builder = null;
         try {
-            builder = (AbstractWSDLBuilder) Class.forName(fullClzName).newInstance();
+            builder = (AbstractWSDLBuilder<? extends Object>) Class.forName(fullClzName).newInstance();
             
         } catch (Exception e) {
             LOG.log(Level.SEVERE, "LOAD_PROCESSOR_FAILED", fullClzName);

Copied: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/WSDLToProcessor.java (from r489301, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/WSDLToProcessor.java?view=diff&rev=489592&p1=incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java&r1=489301&p2=incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/WSDLToProcessor.java&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/WSDLToProcessor.java Fri Dec 22 01:44:31 2006
@@ -17,96 +17,40 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.wsdl2java.processor;
+package org.apache.cxf.tools.wsdlto.core;
 
 import java.io.File;
 import java.io.IOException;
 import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
 import java.util.Properties;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import javax.jws.soap.SOAPBinding;
-import javax.wsdl.Binding;
-import javax.wsdl.BindingOperation;
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.wsdl.Types;
-
-import javax.wsdl.extensions.schema.Schema;
-import javax.wsdl.extensions.schema.SchemaImport;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.namespace.QName;
-
-import org.xml.sax.InputSource;
-
-import com.sun.tools.xjc.api.S2JJAXBModel;
-import com.sun.tools.xjc.model.Model;
-
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.resource.URIResolver;
-import org.apache.cxf.tools.common.DataBindingGenerator;
-import org.apache.cxf.tools.common.FrontEndGenerator;
+import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.common.Processor;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
-import org.apache.cxf.tools.common.extensions.jaxws.CustomizationParser;
 import org.apache.cxf.tools.util.ClassCollector;
 import org.apache.cxf.tools.util.FileWriterUtil;
-import org.apache.cxf.tools.util.SOAPBindingUtil;
-import org.apache.cxf.tools.util.WSDLExtensionRegister;
-import org.apache.cxf.tools.validator.internal.WSDL11Validator;
-import org.apache.cxf.tools.wsdl2java.databindings.jaxb.JAXBBindingGenerator;
-
-import org.apache.cxf.wsdl4jutils.WSDLResolver;
 import org.apache.velocity.app.Velocity;
 
 public class WSDLToProcessor implements Processor {
     protected static final Logger LOG = LogUtils.getL7dLogger(WSDLToProcessor.class);
     protected static final String WSDL_FILE_NAME_EXT = ".wsdl";
 
-    protected Definition wsdlDefinition;
-    protected ToolContext env;
-    protected WSDLFactory wsdlFactory;
-    protected WSDLReader wsdlReader;
-    protected S2JJAXBModel rawJaxbModel;
-    protected S2JJAXBModel rawJaxbModelGenCode;
-
-    protected ClassCollector classColletor;
-    protected List<String> excludePkgList = new ArrayList<String>();
-    protected List<String> excludeGenFiles;
-    protected Map<QName, Service> importedServices = new java.util.HashMap<QName, Service>();
-    protected Map<QName, PortType> importedPortTypes = new java.util.HashMap<QName, PortType>();
-    protected List<FrontEndGenerator> generators;
-
-    //  For process nestedJaxbBinding
-    protected boolean nestedJaxbBinding;
-    protected Model model;
-    protected DataBindingGenerator bindingGenerator;
-
-    protected List<Schema> schemaList = new ArrayList<Schema>();
-    private List<Definition> importedDefinitions = new ArrayList<Definition>();
-    private List<String> schemaTargetNamespaces = new ArrayList<String>();
+    protected ToolContext context;
 
     protected Writer getOutputWriter(String newNameExt) throws ToolException {
         Writer writer = null;
         String newName = null;
         String outputDir;
 
-        if (env.get(ToolConstants.CFG_OUTPUTFILE) != null) {
-            newName = (String)env.get(ToolConstants.CFG_OUTPUTFILE);
+        if (context.get(ToolConstants.CFG_OUTPUTFILE) != null) {
+            newName = (String)context.get(ToolConstants.CFG_OUTPUTFILE);
         } else {
-            String oldName = (String)env.get(ToolConstants.CFG_WSDLURL);
+            String oldName = (String)context.get(ToolConstants.CFG_WSDLURL);
             int position = oldName.lastIndexOf("/");
             if (position < 0) {
                 position = oldName.lastIndexOf("\\");
@@ -120,8 +64,8 @@
                 newName = oldName + newNameExt;
             }
         }
-        if (env.get(ToolConstants.CFG_OUTPUTDIR) != null) {
-            outputDir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
+        if (context.get(ToolConstants.CFG_OUTPUTDIR) != null) {
+            outputDir = (String)context.get(ToolConstants.CFG_OUTPUTDIR);
             if (!("/".equals(outputDir.substring(outputDir.length() - 1)) || "\\".equals(outputDir
                 .substring(outputDir.length() - 1)))) {
                 outputDir = outputDir + "/";
@@ -135,74 +79,15 @@
         } catch (IOException ioe) {
             org.apache.cxf.common.i18n.Message msg =
                 new org.apache.cxf.common.i18n.Message("FAIL_TO_WRITE_FILE",
-                                                              LOG,
-                                                              env.get(ToolConstants.CFG_OUTPUTDIR)
-                                                              + System.getProperty("file.seperator")
-                                                              + newName);
+                                                       LOG,
+                                                       context.get(ToolConstants.CFG_OUTPUTDIR)
+                                                       + System.getProperty("file.seperator")
+                                                       + newName);
             throw new ToolException(msg, ioe);
         }
         return writer;
     }
 
-    protected void parseWSDL(String wsdlURL) throws ToolException {
-        try {
-            wsdlFactory = WSDLFactory.newInstance();
-            wsdlReader = wsdlFactory.newWSDLReader();
-            wsdlReader.setFeature("javax.wsdl.verbose", false);
-            WSDLExtensionRegister register = new WSDLExtensionRegister(wsdlFactory, wsdlReader);
-            register.registerExtensions();
-            URIResolver resolver = new URIResolver(wsdlURL);
-            InputSource insource = new InputSource(resolver.getInputStream());
-            wsdlURL = resolver.getURI().toString();
-            wsdlDefinition = wsdlReader.readWSDL(new WSDLResolver(wsdlURL, insource));
-            
-            parseImports(wsdlDefinition);
-            buildImportedMaps();
-        } catch (Exception we) {
-            org.apache.cxf.common.i18n.Message msg =
-                new org.apache.cxf.common.i18n.Message("FAIL_TO_CREATE_WSDL_DEFINITION",
-                                                             LOG, wsdlURL);
-            throw new ToolException(msg, we);
-        }
-
-    }
-
-    @SuppressWarnings("unchecked")
-    private void buildImportedMaps() {
-        for (Definition def : importedDefinitions) {
-            for (java.util.Iterator<QName> ite = def.getServices().keySet().iterator(); ite.hasNext();) {
-                QName qn = ite.next();
-                importedServices.put(qn, (Service)def.getServices().get(qn));
-            }
-
-        }
-
-        if (getWSDLDefinition().getServices().size() == 0 && importedServices.size() == 0) {
-            for (Definition def : importedDefinitions) {
-                for (java.util.Iterator<QName> ite = def.getPortTypes().keySet().iterator(); ite.hasNext();) {
-                    QName qn = ite.next();
-                    importedPortTypes.put(qn, (PortType)def.getPortTypes().get(qn));
-                }
-
-            }
-
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    private void parseImports(Definition def) {
-        List<Import> importList = new ArrayList<Import>();
-        Map imports = def.getImports();
-        for (Iterator iter = imports.keySet().iterator(); iter.hasNext();) {
-            String uri = (String)iter.next();
-            importList.addAll((List<Import>)imports.get(uri));
-        }
-        for (Import impt : importList) {
-            parseImports(impt.getDefinition());
-            importedDefinitions.add(impt.getDefinition());
-        }
-    }
-
     private String getVelocityLogFile(String logfile) {
         String logdir = System.getProperty("user.home");
         if (logdir == null || logdir.length() == 0) {
@@ -229,217 +114,24 @@
         }
     }
 
-    private void extractSchema(Definition def) {
-        Types typesElement = def.getTypes();
-        if (typesElement != null) {
-            Iterator ite = typesElement.getExtensibilityElements().iterator();
-            while (ite.hasNext()) {
-                Object obj = ite.next();
-                if (obj instanceof Schema) {
-                    Schema schema = (Schema)obj;
-                    addSchema(schema);
-                }
-            }
-        }
-    }
-
-    private void initDataModel() {
-        schemaTargetNamespaces.clear();
-        extractSchema(wsdlDefinition);
-        for (Definition def : importedDefinitions) {
-            extractSchema(def);
-        }
-        env.put(ToolConstants.WSDL_DEFINITION, wsdlDefinition);
-        env.put(ToolConstants.IMPORTED_DEFINITION, importedDefinitions);
-        env.put(ToolConstants.SCHEMA_LIST, schemaList);
-        env.put(ToolConstants.SCHEMA_TARGET_NAMESPACES, schemaTargetNamespaces);
-        env.put(ToolConstants.PORTTYPE_MAP, getPortTypes(wsdlDefinition));
-
-        if (schemaList.size() == 0) {
-            if (env.isVerbose()) {
-                System.err.println("No schema provided in the wsdl file");
-            }
-            return;
-        }
-
-        try {
-            bindingGenerator = (DataBindingGenerator)new JAXBBindingGenerator();
-            bindingGenerator.initialize(env);
-            env.put(ToolConstants.BINDING_GENERATOR, bindingGenerator);
-        
-        } catch (Exception e) {
-            org.apache.cxf.common.i18n.Message msg =
-                new org.apache.cxf.common.i18n.Message("FAIL_TO_CREATE_DATABINDING_MODEL",
-                                                             LOG, new Object[] {e.getLocalizedMessage()});
-            LOG.log(Level.SEVERE, msg.toString());
-            throw new ToolException(msg, e);
-        }
-    }
-
-    
-
-    @SuppressWarnings("unchecked")
-    protected Map<QName, PortType> getPortTypes(Definition definition) {
-        Map<QName, PortType> portTypes = definition.getPortTypes();
-        if (portTypes.size() == 0) {
-            for (Iterator ite = definition.getServices().values().iterator(); ite.hasNext();) {
-                Service service = (Service)ite.next();
-                for (Iterator ite2 = service.getPorts().values().iterator(); ite2.hasNext();) {
-                    Port port = (Port)ite2.next();
-                    Binding binding = port.getBinding();
-                    portTypes.put(binding.getPortType().getQName(), binding.getPortType());
-                }
-            }
-        }
-
-        if (portTypes.size() == 0) {
-            for (Iterator ite = importedServices.values().iterator(); ite.hasNext();) {
-                Service service = (Service)ite.next();
-                for (Iterator ite2 = service.getPorts().values().iterator(); ite2.hasNext();) {
-                    Port port = (Port)ite2.next();
-                    Binding binding = port.getBinding();
-                    portTypes.put(binding.getPortType().getQName(), binding.getPortType());
-                }
-            }
-        }
-
-        if (portTypes.size() == 0) {
-            portTypes.putAll(importedPortTypes);
-        }
-
-        return portTypes;
-    }
-
-    private boolean isSchemaParsed(String targetNamespace) {
-        if (!schemaTargetNamespaces.contains(targetNamespace)) {
-            schemaTargetNamespaces.add(targetNamespace);
-            return false;
-        } else {
-            return true;
-        }
-    }
-    
-    
-    private boolean isSchemaImported(Schema schema) {
-        return schemaList.contains(schema);
-    }
-
-    @SuppressWarnings("unchecked")
-    private void addSchema(Schema schema) {
-   
-        Map<String, List> imports = schema.getImports();
-        if (imports != null && imports.size() > 0) {
-            Collection<String> importKeys = imports.keySet();
-            for (String importNamespace : importKeys) {
-                if (!isSchemaParsed(importNamespace + "?file=" + schema.getDocumentBaseURI())) {
-                    List<SchemaImport> schemaImports = imports.get(importNamespace);
-                    for (SchemaImport schemaImport : schemaImports) {
-                        Schema tempImport = schemaImport.getReferencedSchema();
-                        if (tempImport != null && !isSchemaImported(tempImport)) {
-                            addSchema(tempImport);
-                        }
-                    }
-                }
-            }
-        }
-        if (!isSchemaImported(schema)) {
-            schemaList.add(schema);
-        }
-    }
-
-    public void parseCustomization(Definition def) {
-        CustomizationParser customizationParser = CustomizationParser.getInstance();
-        customizationParser.clean();
-        if (!env.optionSet(ToolConstants.CFG_BINDING)) {
-            return;
-        }
-        customizationParser.parse(env, def);
-    }
-
-    protected void init() throws ToolException {
-        parseWSDL((String)env.get(ToolConstants.CFG_WSDLURL));
-        checkSupported(getWSDLDefinition());
-        validateWSDL(getWSDLDefinition());
-        parseCustomization(getWSDLDefinition());
+    private void init() throws ToolException {
         initVelocity();
-        classColletor = new ClassCollector();
-        env.put(ToolConstants.GENERATED_CLASS_COLLECTOR, classColletor);
-        initDataModel();
-
-    }
-
-    
-
-    public Definition getWSDLDefinition() {
-        return this.wsdlDefinition;
+        context.put(ClassCollector.class, new ClassCollector());
     }
 
     public void process() throws ToolException {
-    }
-
-    public void validateWSDL(Definition def) throws ToolException {
-        if (env.validateWSDL()) {
-            WSDL11Validator validator = new WSDL11Validator(def, this.env);
-            validator.isValid();
-        }
-    }
-
-    protected void doGeneration() throws ToolException {
-        for (FrontEndGenerator plugin : generators) {
-            plugin.generate(env);
-        }
+        init();
     }
 
     public void setEnvironment(ToolContext penv) {
-        this.env = penv;
+        this.context = penv;
     }
 
     public ToolContext getEnvironment() {
-        return this.env;
+        return this.context;
     }
-
     
-
-    public void checkSupported(Definition def) throws ToolException {
-        if (isRPCEncoded(wsdlDefinition)) {
-            org.apache.cxf.common.i18n.Message msg =
-                new org.apache.cxf.common.i18n.Message("UNSUPPORTED_RPC_ENCODED",
-                                                             LOG);
-            throw new ToolException(msg);
-        }
+    public ServiceInfo getServiceInfo() {
+        return context.get(ServiceInfo.class);
     }
-
-    private boolean isRPCEncoded(Definition def) {
-        Iterator ite1 = def.getBindings().values().iterator();
-        while (ite1.hasNext()) {
-            Binding binding = (Binding)ite1.next();
-            String bindingStyle = SOAPBindingUtil.getBindingStyle(binding);
-
-            Iterator ite2 = binding.getBindingOperations().iterator();
-            while (ite2.hasNext()) {
-                BindingOperation bop = (BindingOperation)ite2.next();
-                String bopStyle = SOAPBindingUtil.getSOAPOperationStyle(bop);
-
-                String outputUse = "";
-                if (SOAPBindingUtil.getBindingOutputSOAPBody(bop) != null) {
-                    outputUse = SOAPBindingUtil.getBindingOutputSOAPBody(bop).getUse();
-                }
-                String inputUse = "";
-                if (SOAPBindingUtil.getBindingInputSOAPBody(bop) != null) {
-                    inputUse = SOAPBindingUtil.getBindingInputSOAPBody(bop).getUse();
-                }
-                if ((SOAPBinding.Style.RPC.name().equalsIgnoreCase(bindingStyle) || SOAPBinding.Style.RPC
-                    .name().equalsIgnoreCase(bopStyle))
-                    && (SOAPBinding.Use.ENCODED.name().equalsIgnoreCase(inputUse) || SOAPBinding.Use.ENCODED
-                        .name().equalsIgnoreCase(outputUse))) {
-                    return true;
-                }
-            }
-
-        }
-        return false;
-    }
-
-    
-
 }

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml Fri Dec 22 01:44:31 2006
@@ -55,6 +55,12 @@
 
 	<dependency>
 	    <groupId>org.apache.cxf</groupId>
+	    <artifactId>cxf-tools-validator</artifactId>
+	    <version>${project.version}</version>
+	</dependency>
+
+	<dependency>
+	    <groupId>org.apache.cxf</groupId>
 	    <artifactId>cxf-rt-core</artifactId>
 	    <version>${project.version}</version>
 	</dependency>

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml?view=diff&rev=489592&r1=489591&r2=489592
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml Fri Dec 22 01:44:31 2006
@@ -78,6 +78,18 @@
 		</associatedArgument>
 	    </option>
 
+	    <option id="servicename">
+		<annotation>
+		    The wsdl service name name to use for the generated code.
+		    Also, optionally specify the wsdl namespace.
+		</annotation>
+		<switch>sn</switch>
+		<associatedArgument placement="afterSpace">
+		    <valuetype>NamingSpacePackageString</valuetype>
+		<annotation>[wsdl namespace =]Package Name</annotation>
+		</associatedArgument>
+	    </option>
+
 	    <option id="binding" maxOccurs="unbounded">
 		<annotation>
 		            Specify external jaxws or jaxb binding files, (Each 



Mime
View raw message