cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r504085 [1/2] - in /incubator/cxf/trunk: rt/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ tools2/ tools2/common/src/main/java/org/apache/cxf/tools/common/ tools2/common/src/test/java/org/apache/cxf/tools/common/ tools2/j...
Date Tue, 06 Feb 2007 11:26:17 GMT
Author: mmao
Date: Tue Feb  6 03:26:13 2007
New Revision: 504085

URL: http://svn.apache.org/viewvc?view=rev&rev=504085
Log:
CXF-312
* Refactroing java2wsdl to reuse service model
* Port Java2wsdl from tools to tools2
* Support simple frontend
* Reuse the previous java2wsdl tools for wsdl gen from jaxws class, since use JaxWsServiceFactoryBean can not pass the tests.
  We can remove the whole java2wsdl tools after we fix all the tests.

Added:
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/WSDLVersion.java
      - copied, changed from r503552, incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLVersion.java
    incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/common/WSDLVersionTest.java
      - copied, changed from r503552, incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/WSDLVersionTest.java
    incubator/cxf/trunk/tools2/javato/
    incubator/cxf/trunk/tools2/javato/Hello.wsdl   (with props)
    incubator/cxf/trunk/tools2/javato/pom.xml
      - copied, changed from r502145, incubator/cxf/trunk/tools/java2wsdl/pom.xml
    incubator/cxf/trunk/tools2/javato/src/
    incubator/cxf/trunk/tools2/javato/src/main/
    incubator/cxf/trunk/tools2/javato/src/main/java/
    incubator/cxf/trunk/tools2/javato/src/main/java/org/
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java
      - copied, changed from r502145, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/Messages.properties
      - copied unchanged from r502145, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/Messages.properties
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/AbstractGenerator.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/BindingGenerator.java
      - copied, changed from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/BindingGenerator.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/MessagePortTypeGenerator.java
      - copied, changed from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/MessagePortTypeGenerator.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/ServiceGenerator.java
      - copied, changed from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/ServiceGenerator.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/TypesGenerator.java
      - copied, changed from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/TypesGenerator.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/WSDLGenerator.java
      - copied, changed from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGenerator.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/WSDLOutputResolver.java
      - copied, changed from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLOutputResolver.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WSDL11Generator.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl20/
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/java2wsdl.xml
      - copied unchanged from r502145, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/java2wsdl.xml
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/FrontendFactory.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
      - copied, changed from r502145, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/Messages.properties
      - copied, changed from r502145, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/Messages.properties
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilder.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ClassProcessor.java
      - copied, changed from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ClassProcessor.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocBareMethodProcessor.java
      - copied, changed from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DocBareMethodProcessor.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocWrapperMethodProcessor.java
      - copied, changed from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DocWrapperMethodProcessor.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilder.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties   (with props)
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RPCMethodProcessor.java
      - copied, changed from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/RPCMethodProcessor.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtil.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/SimpleServiceBuilder.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/main/resources/
      - copied from r502145, incubator/cxf/trunk/tools/java2wsdl/src/main/resources/
    incubator/cxf/trunk/tools2/javato/src/main/resources/META-INF/
      - copied from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/resources/META-INF/
    incubator/cxf/trunk/tools2/javato/src/test/
    incubator/cxf/trunk/tools2/javato/src/test/java/
    incubator/cxf/trunk/tools2/javato/src/test/java/org/
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/common/
      - copied from r503552, incubator/cxf/trunk/tools/java2wsdl/src/test/java/org/apache/cxf/tools/common/
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/
      - copied from r503552, incubator/cxf/trunk/tools/java2wsdl/src/test/java/org/apache/cxf/tools/fortest/
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/simple/
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/simple/Hello.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/Hello.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/JavaToWSDLTest.java
      - copied unchanged from r503552, incubator/cxf/trunk/tools/java2wsdl/src/test/java/org/apache/cxf/tools/java2wsdl/JavaToWSDLTest.java
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/generator/
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/FrontendFactoryTest.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLNoAnnoTest.java
      - copied unchanged from r503552, incubator/cxf/trunk/tools/java2wsdl/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLNoAnnoTest.java
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java
      - copied, changed from r503552, incubator/cxf/trunk/tools/java2wsdl/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/ProcessorTestBase.java
      - copied unchanged from r503552, incubator/cxf/trunk/tools/java2wsdl/src/test/java/org/apache/cxf/tools/java2wsdl/processor/ProcessorTestBase.java
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactoryTest.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtilTest.java   (with props)
    incubator/cxf/trunk/tools2/javato/src/test/resources/
      - copied from r503552, incubator/cxf/trunk/tools/java2wsdl/src/test/resources/
Removed:
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLVersion.java
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/WSDLVersionTest.java
Modified:
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/pom.xml
    incubator/cxf/trunk/tools2/javato/src/test/resources/java2wsdl_wsdl/hello_world_soap12.wsdl
    incubator/cxf/trunk/tools2/pom.xml
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=504085&r1=504084&r2=504085
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Tue Feb  6 03:26:13 2007
@@ -171,45 +171,52 @@
             c.setServiceFactory(this);
         }
     }
+    
+    protected void buildServiceFromWSDL(URL url) {
+        LOG.info("Creating Service " + getServiceQName() + " from WSDL.");
+        WSDLServiceFactory factory = new WSDLServiceFactory(getBus(), url, getServiceQName());
+
+        setService(factory.create());
+
+        initializeWSDLOperations();
+
+        if (getDataBinding() != null) {
+            getDataBinding().initialize(getService().getServiceInfo());
+        }        
+    }
+    
+    protected void buildServiceFromClass() {
+        LOG.info("Creating Service " + getServiceQName() + " from class " + getServiceClass().getName());
+        ServiceInfo serviceInfo = new ServiceInfo();
+        ServiceImpl service = new ServiceImpl(serviceInfo);
+        
+        serviceInfo.setName(getServiceQName());
+        serviceInfo.setTargetNamespace(serviceInfo.getName().getNamespaceURI());
+        
+        createInterface(serviceInfo);
+
+        if (isWrapped()) {
+            initializeWrappedElementNames(serviceInfo);
+        }
+        
+        if (getDataBinding() != null) {
+            getDataBinding().initialize(serviceInfo);
+        }
+        
+        if (isWrapped()) {
+            initializeWrappedSchema(serviceInfo);
+        }
+        
+        setService(service);        
+    }
 
     protected void initializeServiceModel() {
         URL url = getWsdlURL();
 
         if (url != null) {
-            LOG.info("Creating Service " + getServiceQName() + " from WSDL.");
-            WSDLServiceFactory factory = new WSDLServiceFactory(getBus(), url, getServiceQName());
-
-            setService(factory.create());
-
-            initializeWSDLOperations();
-
-            if (getDataBinding() != null) {
-                getDataBinding().initialize(getService().getServiceInfo());
-            }
+            buildServiceFromWSDL(url);
         } else {
-            LOG.info("Creating Service " + getServiceQName() + " from class " + getServiceClass().getName());
-            // If we can't find the wsdlLocation, then we should build a service model ufrom the class.
-            ServiceInfo serviceInfo = new ServiceInfo();
-            ServiceImpl service = new ServiceImpl(serviceInfo);
-            
-            serviceInfo.setName(getServiceQName());
-            serviceInfo.setTargetNamespace(serviceInfo.getName().getNamespaceURI());
-            
-            createInterface(serviceInfo);
-
-            if (isWrapped()) {
-                initializeWrappedElementNames(serviceInfo);
-            }
-            
-            if (getDataBinding() != null) {
-                getDataBinding().initialize(serviceInfo);
-            }
-            
-            if (isWrapped()) {
-                initializeWrappedSchema(serviceInfo);
-            }
-            
-            setService(service);
+            buildServiceFromClass();
         }
         
         if (properties != null) {

Modified: incubator/cxf/trunk/rt/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/pom.xml?view=diff&rev=504085&r1=504084&r2=504085
==============================================================================
--- incubator/cxf/trunk/rt/pom.xml (original)
+++ incubator/cxf/trunk/rt/pom.xml Tue Feb  6 03:26:13 2007
@@ -45,7 +45,6 @@
         <module>frontend/jaxws</module>
         <module>frontend/js</module>
         <module>transports/http</module>
-        <module>transports/http2</module>
         <module>transports/jms</module>
         <module>ws/policy</module>
         <module>ws/addr</module>

Copied: incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/WSDLVersion.java (from r503552, incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLVersion.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/WSDLVersion.java?view=diff&rev=504085&p1=incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLVersion.java&r1=503552&p2=incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/WSDLVersion.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLVersion.java (original)
+++ incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/WSDLVersion.java Tue Feb  6 03:26:13 2007
@@ -17,9 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.wsdlto;
-
-import org.apache.cxf.tools.common.ToolConstants;
+package org.apache.cxf.tools.common;
 
 public final class WSDLVersion {
 

Copied: incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/common/WSDLVersionTest.java (from r503552, incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/WSDLVersionTest.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/common/WSDLVersionTest.java?view=diff&rev=504085&p1=incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/WSDLVersionTest.java&r1=503552&p2=incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/common/WSDLVersionTest.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/WSDLVersionTest.java (original)
+++ incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/common/WSDLVersionTest.java Tue Feb  6 03:26:13 2007
@@ -17,11 +17,9 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.wsdlto;
+package org.apache.cxf.tools.common;
 
 import junit.framework.TestCase;
-
-import org.apache.cxf.tools.common.ToolConstants;
 
 public class WSDLVersionTest extends TestCase {
     

Added: incubator/cxf/trunk/tools2/javato/Hello.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/Hello.wsdl?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/Hello.wsdl (added)
+++ incubator/cxf/trunk/tools2/javato/Hello.wsdl Tue Feb  6 03:26:13 2007
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="Hello" targetNamespace="http://cxf.com/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://cxf.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+  <wsdl:message name="sayHi">
+  </wsdl:message>
+  <wsdl:message name="sayHiResponse">
+    <wsdl:part name="return" type="xsd:string">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="HelloPortType">
+    <wsdl:operation name="sayHi">
+      <wsdl:input name="sayHi" message="ns1:sayHi">
+    </wsdl:input>
+      <wsdl:output name="sayHiResponse" message="ns1:sayHiResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="HelloSoapBinding" type="ns1:HelloPortType">
+    <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="sayHi">
+      <wsdlsoap:operation soapAction="" style="document"/>
+      <wsdl:input name="sayHi">
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output name="sayHiResponse">
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="Hello">
+    <wsdl:port name="HelloPort" binding="ns1:HelloSoapBinding">
+      <wsdlsoap:address location="http://localhost:9090/hello"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Propchange: incubator/cxf/trunk/tools2/javato/Hello.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/Hello.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools2/javato/Hello.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Copied: incubator/cxf/trunk/tools2/javato/pom.xml (from r502145, incubator/cxf/trunk/tools/java2wsdl/pom.xml)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/pom.xml?view=diff&rev=504085&p1=incubator/cxf/trunk/tools/java2wsdl/pom.xml&r1=502145&p2=incubator/cxf/trunk/tools2/javato/pom.xml&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/pom.xml (original)
+++ incubator/cxf/trunk/tools2/javato/pom.xml Tue Feb  6 03:26:13 2007
@@ -1,113 +1,120 @@
 <!--
-  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.
+    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.
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.cxf</groupId>
-    <artifactId>cxf-tools-java2wsdl</artifactId>
+    <artifactId>cxf-tools2-java2wsdl</artifactId>
     <packaging>jar</packaging>
     <version>2.0-incubator-RC-SNAPSHOT</version>
-    <name>Apache CXF Command Line Tools Java2Wsdl</name>
+    <name>Apache CXF Command Line Tools2 JavaTo</name>
     <url>http://cwiki.apache.org/confluence/display/CXF/Index</url>
 
     <parent>
-        <groupId>org.apache.cxf</groupId>
-        <artifactId>cxf-tools</artifactId>
-        <version>2.0-incubator-RC-SNAPSHOT</version>
+	<groupId>org.apache.cxf</groupId>
+	<artifactId>cxf-tools2</artifactId>
+	<version>2.0-incubator-RC-SNAPSHOT</version>
     </parent>
 
     <properties>
-        <topDirectoryLocation>../../</topDirectoryLocation>
+	<topDirectoryLocation>../../</topDirectoryLocation>
     </properties>
 
     <dependencies>
-	                      
+	
 
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-tools-common</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-	        
+	<dependency>
+	    <groupId>org.apache.cxf</groupId>
+	    <artifactId>cxf-tools2-common</artifactId>
+	    <version>${project.version}</version>
+	</dependency>
+	
+
+	<dependency>
+	    <groupId>junit</groupId>
+	    <artifactId>junit</artifactId>
+	    <scope>test</scope>
+	</dependency>
+	
+
+	<dependency>
+	    <groupId>org.easymock</groupId>
+	    <artifactId>easymockclassextension</artifactId>
+	    <scope>test</scope>
+	</dependency>
+	
+
+	<dependency>
+	    <groupId>asm</groupId>
+	    <artifactId>asm</artifactId>
+	    <scope>test</scope>
+	</dependency>
+	
+
+	<dependency>
+	    <groupId>wsdl4j</groupId>
+	    <artifactId>wsdl4j</artifactId>
+	</dependency>
+	
+
+	<dependency>
+	    <groupId>com.sun.xml.bind</groupId>
+	    <artifactId>jaxb-xjc</artifactId>
+	</dependency>
+	<dependency>
+	    <groupId>javax.xml.ws</groupId>
+	    <artifactId>jaxws-api</artifactId>
+	    <scope>provided</scope>
+	</dependency>               
+
+	<dependency>
+	    <groupId>com.sun.xml.bind</groupId>
+	    <artifactId>jaxb-impl</artifactId>
+	</dependency>
+	<dependency>
+	    <groupId>javax.xml.soap</groupId>
+	    <artifactId>saaj-api</artifactId>
+	</dependency>
+
+	<dependency>
+	    <groupId>org.codehaus.woodstox</groupId>
+	    <artifactId>wstx-asl</artifactId>
+	    <scope>runtime</scope>
+	</dependency>
+
+	<dependency>
+	    <groupId>org.apache.cxf</groupId>
+	    <artifactId>cxf-rt-frontend-jaxws</artifactId>
+	    <version>${project.version}</version>
+	    <exclusions>
+		<exclusion>
+		    <groupId>org.apache.cxf</groupId>
+		    <artifactId>cxf-tools-common</artifactId>
+		</exclusion>
+	    </exclusions>
+	</dependency>
 
         <dependency>
             <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-tools-wsdl2java</artifactId>
+            <artifactId>cxf-tools2-wsdlto-test</artifactId>
             <version>${project.version}</version>
+	    <scope>test</scope>
         </dependency>
-	       
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-               
-
-        <dependency>
-            <groupId>org.easymock</groupId>
-            <artifactId>easymockclassextension</artifactId>
-            <scope>test</scope>
-        </dependency>
-               
-
-        <dependency>
-            <groupId>asm</groupId>
-            <artifactId>asm</artifactId>
-            <scope>test</scope>
-        </dependency>
-              
-
-        <dependency>
-            <groupId>velocity</groupId>
-            <artifactId>velocity</artifactId>
-        </dependency>
-       
-
-        <dependency>
-            <groupId>wsdl4j</groupId>
-            <artifactId>wsdl4j</artifactId>
-        </dependency>
-               
-
-        <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-xjc</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>javax.xml.ws</groupId>
-            <artifactId>jaxws-api</artifactId>
-            <scope>provided</scope>
-	    </dependency>               
 
-        <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-impl</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>javax.xml.soap</groupId>
-            <artifactId>saaj-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.codehaus.woodstox</groupId>
-            <artifactId>wstx-asl</artifactId>
-            <scope>runtime</scope>
-        </dependency>
     </dependencies>
 </project>

Copied: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java (from r502145, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java?view=diff&rev=504085&p1=incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java&r1=502145&p2=incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java (original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java Tue Feb  6 03:26:13 2007
@@ -21,10 +21,9 @@
 
 import java.util.HashSet;
 
-import javax.wsdl.Definition;
-
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.tools.common.AbstractCXFToolContainer;
+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;
@@ -32,21 +31,23 @@
 import org.apache.cxf.tools.common.toolspec.ToolSpec;
 import org.apache.cxf.tools.common.toolspec.parser.BadUsageException;
 import org.apache.cxf.tools.common.toolspec.parser.ErrorVisitor;
+import org.apache.cxf.tools.java2wsdl.processor.FrontendFactory;
+import org.apache.cxf.tools.java2wsdl.processor.JavaToProcessor;
 import org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor;
+import org.apache.cxf.tools.util.AnnotationUtil;
 
 public class JavaToWSDL extends AbstractCXFToolContainer {
    
     private static final String TOOL_NAME = "java2wsdl";
     private static String[] args;
-    private static Definition definition;
 
     public JavaToWSDL(ToolSpec toolspec) throws Exception {
         super(TOOL_NAME, toolspec);
     }
 
     public void execute(boolean exitOnFinish) throws ToolException {
-        JavaToWSDLProcessor processor = new JavaToWSDLProcessor();
-        
+        Processor processor = null;
+
         try {
             super.execute(exitOnFinish);
             if (!hasInfoOption()) {
@@ -55,9 +56,22 @@
                 if (isVerboseOn()) {
                     env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
                 }
+
+                // REVISIT: We keep the previous java2wsdl tool for the jaxws generation
+                //          due to there are bugs in JaxWsServiceFactoryBean
+                //          if we fix those bugs, then safely remove the following condition
+                //          just use processor = new JavaToProcessor();
+                
+                FrontendFactory frontend = FrontendFactory.getInstance();
+                frontend.setServiceClass(getServiceClass(env));
+                if (FrontendFactory.Style.Simple == frontend.discoverStyle()) {
+                    processor = new JavaToProcessor();
+                } else {
+                    processor = new JavaToWSDLProcessor();
+                }
+                
                 processor.setEnvironment(env);
                 processor.process();
-                definition = processor.getModel().getDefinition();
             }
         } catch (ToolException ex) {            
             if (ex.getCause() instanceof BadUsageException) {
@@ -69,6 +83,11 @@
         }
     }
 
+    public Class getServiceClass(ToolContext context) {
+        return AnnotationUtil.loadClass((String)context.get(ToolConstants.CFG_CLASSNAME),
+                                        getClass().getClassLoader());
+    }
+
     public static void main(String[] pargs) { 
         try {
             runTool(pargs);
@@ -98,10 +117,5 @@
             Message msg = new Message("PARAMETER_MISSSING", LOG);
             throw new ToolException(msg, new BadUsageException(getUsage(), errors));
         }
-    }
-    
-    
-    public static Definition getDefinition() {
-        return definition;
     }
 }

Added: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/AbstractGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/AbstractGenerator.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/AbstractGenerator.java (added)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/AbstractGenerator.java Tue Feb  6 03:26:13 2007
@@ -0,0 +1,48 @@
+/**
+ * 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.java2wsdl.generator;
+
+import java.io.File;
+import org.apache.cxf.service.model.ServiceInfo;
+
+public abstract class AbstractGenerator<T> {
+    private ServiceInfo service;
+
+    public void setServiceModel(ServiceInfo s) {
+        this.service = s;
+    }
+
+    public ServiceInfo getServiceModel() {
+        return this.service;
+    }
+
+    public abstract T generate(File file);
+
+    protected void createOutputDir(File file) {
+        String parent = file.getParent();
+        if (parent == null) {
+            return;
+        }
+        File parentDir = new File(parent);
+        if (parentDir.isDirectory() && !parentDir.exists()) {
+            parentDir.mkdirs();
+        }
+    }
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/AbstractGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/AbstractGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java (added)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java Tue Feb  6 03:26:13 2007
@@ -0,0 +1,60 @@
+/**
+ * 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.java2wsdl.generator;
+
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolException;
+
+public final class WSDLGeneratorFactory {
+    private static WSDLGeneratorFactory instance;
+    private ToolConstants.WSDLVersion wsdlVersion;
+    
+    private WSDLGeneratorFactory() {
+    }
+
+    public static WSDLGeneratorFactory getInstance() {
+        if (instance == null) {
+            instance = new WSDLGeneratorFactory();
+        }
+        return instance;
+    }
+
+    public void setWSDLVersion(ToolConstants.WSDLVersion v) {
+        this.wsdlVersion = v;
+    }
+
+    protected String getGeneratorClassName() {
+        String pkgName = getClass().getPackage().getName();
+        return pkgName + "." + wsdlVersion.toString().toLowerCase() + "." + wsdlVersion + "Generator";
+    }
+
+    public AbstractGenerator newGenerator() {
+        AbstractGenerator generator = null;
+        String clzName = getGeneratorClassName();
+        try {
+            generator = (AbstractGenerator) Class.forName(clzName).newInstance();
+        } catch (Exception e) {
+            throw new ToolException("Can not find the Generator for: " + clzName, e);
+        }
+        return generator;
+    }
+}
+
+

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/BindingGenerator.java (from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/BindingGenerator.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/BindingGenerator.java?view=diff&rev=504085&p1=incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/BindingGenerator.java&r1=503552&p2=incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/BindingGenerator.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/BindingGenerator.java (original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/BindingGenerator.java Tue Feb  6 03:26:13 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.java2wsdl.generator;
+package org.apache.cxf.tools.java2wsdl.generator.jaxws;
 
 import java.util.ArrayList;
 import java.util.List;

Copied: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/MessagePortTypeGenerator.java (from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/MessagePortTypeGenerator.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/MessagePortTypeGenerator.java?view=diff&rev=504085&p1=incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/MessagePortTypeGenerator.java&r1=503552&p2=incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/MessagePortTypeGenerator.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/MessagePortTypeGenerator.java (original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/MessagePortTypeGenerator.java Tue Feb  6 03:26:13 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.java2wsdl.generator;
+package org.apache.cxf.tools.java2wsdl.generator.jaxws;
 
 import java.util.Iterator;
 

Copied: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/ServiceGenerator.java (from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/ServiceGenerator.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/ServiceGenerator.java?view=diff&rev=504085&p1=incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/ServiceGenerator.java&r1=503552&p2=incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/ServiceGenerator.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/ServiceGenerator.java (original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/ServiceGenerator.java Tue Feb  6 03:26:13 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.java2wsdl.generator;
+package org.apache.cxf.tools.java2wsdl.generator.jaxws;
 
 import javax.wsdl.Binding;
 import javax.wsdl.Definition;

Copied: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/TypesGenerator.java (from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/TypesGenerator.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/TypesGenerator.java?view=diff&rev=504085&p1=incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/TypesGenerator.java&r1=503552&p2=incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/TypesGenerator.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/TypesGenerator.java (original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/TypesGenerator.java Tue Feb  6 03:26:13 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.java2wsdl.generator;
+package org.apache.cxf.tools.java2wsdl.generator.jaxws;
 
 
 import java.util.Iterator;

Copied: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/WSDLGenerator.java (from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGenerator.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/WSDLGenerator.java?view=diff&rev=504085&p1=incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGenerator.java&r1=503552&p2=incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/WSDLGenerator.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGenerator.java (original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/WSDLGenerator.java Tue Feb  6 03:26:13 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.java2wsdl.generator;
+package org.apache.cxf.tools.java2wsdl.generator.jaxws;
 
 import javax.wsdl.Definition;
 import javax.wsdl.factory.WSDLFactory;

Copied: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/WSDLOutputResolver.java (from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLOutputResolver.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/WSDLOutputResolver.java?view=diff&rev=504085&p1=incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLOutputResolver.java&r1=503552&p2=incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/WSDLOutputResolver.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLOutputResolver.java (original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/WSDLOutputResolver.java Tue Feb  6 03:26:13 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.java2wsdl.generator;
+package org.apache.cxf.tools.java2wsdl.generator.jaxws;
 
 import java.io.File;
 import java.io.FileNotFoundException;

Added: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WSDL11Generator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WSDL11Generator.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WSDL11Generator.java (added)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WSDL11Generator.java Tue Feb  6 03:26:13 2007
@@ -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.java2wsdl.generator.wsdl11;
+
+import java.io.*;
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLWriter;
+
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.java2wsdl.generator.AbstractGenerator;
+import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
+
+public class WSDL11Generator extends AbstractGenerator<Definition> {
+
+    public Definition generate(File file) {
+        createOutputDir(file);
+        Definition def = null;
+        try {
+            OutputStream os = new BufferedOutputStream(new FileOutputStream(file));
+            WSDLWriter wsdlWriter = WSDLFactory.newInstance().newWSDLWriter();
+            def = new ServiceWSDLBuilder(getServiceModel()).build();
+            wsdlWriter.writeWSDL(def, os);
+        } catch (WSDLException wex) {
+            wex.printStackTrace();
+        } catch (FileNotFoundException fnfe) {
+            throw new ToolException("Output file " + file + " not found", fnfe);
+        }
+        return def;
+    }
+}
+

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WSDL11Generator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WSDL11Generator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/FrontendFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/FrontendFactory.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/FrontendFactory.java (added)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/FrontendFactory.java Tue Feb  6 03:26:13 2007
@@ -0,0 +1,118 @@
+/**
+ * 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.java2wsdl.processor;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.soap.SOAPBinding;
+
+import org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.WrapperUtil;
+import org.apache.cxf.tools.util.AnnotationUtil;
+
+public final class FrontendFactory {
+    private static FrontendFactory instance;
+    private Class serviceClass;
+    private List<Method> wsMethods;
+    private Class[] annotations = new Class[] {SOAPBinding.class};
+
+    public enum Style {
+        Jaxws,
+        Simple
+    }
+
+    private FrontendFactory() {
+    }
+
+    public static FrontendFactory getInstance() {
+        if (instance == null) {
+            instance = new FrontendFactory();
+        }
+        return instance;
+    }
+
+    @SuppressWarnings("unchecked")
+    private boolean isJaxws() {
+        if (serviceClass == null) {
+            return true;
+        }
+        for (Class annotation : annotations) {
+            if (serviceClass.getAnnotation(annotation) != null) {
+                return true;
+            }
+        }
+        if (isJAXWSAnnotationExists()) {
+            return true;
+        }
+        return false;
+    }
+
+    private boolean isJAXWSAnnotationExists() {
+        for (Method method : wsMethods) {
+            if (WrapperUtil.isWrapperClassExists(method)) {
+                return true;
+            }
+            WebParam param = AnnotationUtil.getPrivMethodAnnotation(method, WebParam.class);
+            if (param != null) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private List<Method> getWSMethods() {
+        List<Method> methods = new ArrayList<Method>();
+        for (Method method : serviceClass.getMethods()) {
+            if (method.getDeclaringClass().equals(Object.class)
+                || !Modifier.isPublic(method.getModifiers())
+                || isExcluced(method)) {
+                continue;
+            }
+            methods.add(method);
+        }
+        return methods;
+    }
+
+    private boolean isExcluced(Method method) {
+        WebMethod webMethod = AnnotationUtil.getPrivMethodAnnotation(method, WebMethod.class);
+        if (webMethod != null && webMethod.exclude()) {
+            return true;
+        }
+        return false;
+    }
+
+    public Style discoverStyle() {
+        if (isJaxws()) {
+            return Style.Jaxws;
+        }
+        return Style.Simple;
+    }
+
+    public void setServiceClass(Class c) {
+        this.serviceClass = c;
+        if (c != null) {
+            this.wsMethods = getWSMethods();
+        }
+    }
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/FrontendFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/FrontendFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java (added)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java Tue Feb  6 03:26:13 2007
@@ -0,0 +1,122 @@
+/**
+ * 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.java2wsdl.processor;
+
+import java.io.*;
+import java.util.logging.Logger;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+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.WSDLVersion;
+import org.apache.cxf.tools.java2wsdl.generator.AbstractGenerator;
+import org.apache.cxf.tools.java2wsdl.generator.WSDLGeneratorFactory;
+import org.apache.cxf.tools.java2wsdl.processor.internal.ServiceBuilder;
+import org.apache.cxf.tools.java2wsdl.processor.internal.ServiceBuilderFactory;
+import org.apache.cxf.tools.util.AnnotationUtil;
+
+public class JavaToProcessor implements Processor {
+    private static final Logger LOG = LogUtils.getL7dLogger(JavaToProcessor.class);
+    private static final String DEFAULT_BINDING_ID = "http://schemas.xmlsoap.org/soap/http";
+    private static final String DEFAULT_ADDRESS = "http://localhost:9090/hello";
+    private ToolContext context;
+
+    public void process() throws ToolException {
+        init();
+        ServiceBuilderFactory builderFactory = ServiceBuilderFactory.getInstance();
+        builderFactory.setServiceClass(getServiceClass());
+        // TODO check if user specify the style from cli arguments
+        //      builderFactory.setStyle(style/from/command/line);
+        ServiceBuilder builder = builderFactory.newBuilder();
+        builder.setAddress(DEFAULT_ADDRESS);
+        builder.setTransportId(DEFAULT_BINDING_ID);
+        builder.setBus(getBus());
+
+        ServiceInfo service = builder.build();
+
+        File output = getOutputFile(builder.getOutputFile(),
+                                    new File(service.getName().getLocalPart() + ".wsdl"));
+
+        WSDLGeneratorFactory factory = WSDLGeneratorFactory.getInstance();
+        factory.setWSDLVersion(getWSDLVersion());
+
+        AbstractGenerator generator = factory.newGenerator();
+        generator.setServiceModel(service);
+        generator.generate(output);
+    }
+
+    protected File getOutputFile(File nameFromClz, File defaultOutputFile) {
+        File result = defaultOutputFile;
+        String output = (String) context.get(ToolConstants.CFG_OUTPUTFILE);
+        if (output != null) {
+            result = new File(output);
+        }
+        if (nameFromClz != null) {
+            result = nameFromClz;
+        }
+        
+        // rename the exising wsdl file
+        if (result.exists()
+            && !result.renameTo(new File(result.getParent(), result.getName()))) {
+            throw new ToolException(new Message("OUTFILE_EXISTS", LOG));
+        }
+        return result;
+    }
+
+    public Class getServiceClass() {
+        return AnnotationUtil.loadClass((String)context.get(ToolConstants.CFG_CLASSNAME),
+                                        getClass().getClassLoader());
+    }
+
+    public ToolConstants.WSDLVersion getWSDLVersion() {
+        String version = (String) context.get(ToolConstants.CFG_WSDL_VERSION);
+        ToolConstants.WSDLVersion wsVersion = WSDLVersion.getVersion(version);
+        if (wsVersion == ToolConstants.WSDLVersion.UNKNOWN) {
+            wsVersion = ToolConstants.WSDLVersion.WSDL11;
+        }
+        return wsVersion;
+    }
+
+    public Bus getBus() {
+        return BusFactory.newInstance().getDefaultBus();
+    }
+
+    public void setEnvironment(ToolContext env) {
+        this.context = env;
+    }
+
+    public ToolContext getEnvironment() {
+        return this.context;
+    }
+
+    protected void init() {
+        if (context.get(ToolConstants.CFG_CLASSPATH) != null) {
+            String newCp = (String)context.get(ToolConstants.CFG_CLASSPATH);
+            String classpath = System.getProperty("java.class.path");
+            System.setProperty("java.class.path", newCp + File.pathSeparator + classpath);
+        }
+    }
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java (from r502145, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java?view=diff&rev=504085&p1=incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java&r1=502145&p2=incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java (original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java Tue Feb  6 03:26:13 2007
@@ -30,8 +30,8 @@
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.model.WSDLModel;
-import org.apache.cxf.tools.java2wsdl.generator.WSDLGenerator;
-import org.apache.cxf.tools.java2wsdl.processor.internal.ClassProcessor;
+import org.apache.cxf.tools.java2wsdl.generator.jaxws.WSDLGenerator;
+import org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.ClassProcessor;
 import org.apache.cxf.tools.util.AnnotationUtil;
 
 
@@ -86,5 +86,4 @@
     public WSDLModel getModel() {
         return this.model;
     }
-
 }

Copied: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/Messages.properties (from r502145, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/Messages.properties)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/Messages.properties?view=diff&rev=504085&p1=incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/Messages.properties&r1=502145&p2=incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/Messages.properties&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/Messages.properties (original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/Messages.properties Tue Feb  6 03:26:13 2007
@@ -34,6 +34,6 @@
 GENERATE_TYPES_ERROR = Generate types error
 LOAD_REQUEST_WRAPPER_CLASS_ERROR = Can not load the request wrapper class {0},  please check the @RequestWrapper annotation and see if the class is in your classpath  
 LOAD_RESPONSE_WRAPPER_CLASS_ERROR = Can not load the response wrapper class {0}, please check the @ResponseWrapper annotation and see if the class is in your classpath
-SOAPBinding_RPC_ON_METHOD = Method [{0}] processing error : SOAPBinding annotation can not be placed on method with RPC style 
 
 
+OUTFILE_EXISTS = The file [{0}] you are going to generate already exists, please rename
\ No newline at end of file

Added: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilder.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilder.java (added)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilder.java Tue Feb  6 03:26:13 2007
@@ -0,0 +1,55 @@
+/**
+ * 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.java2wsdl.processor.internal;
+
+import java.io.File;
+
+import org.apache.cxf.BusException;
+import org.apache.cxf.binding.soap.SoapBindingInfoFactoryBean;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.endpoint.EndpointException;
+import org.apache.cxf.frontend.AbstractEndpointFactory;
+import org.apache.cxf.service.factory.ServiceConstructionException;
+import org.apache.cxf.service.model.ServiceInfo;
+
+public class ServiceBuilder extends AbstractEndpointFactory {
+
+    public ServiceBuilder() {
+        super();
+        setBindingFactory(new SoapBindingInfoFactoryBean());
+    }
+    
+    public ServiceInfo build() {
+        try {
+            Endpoint ep = createEndpoint();
+            
+            return ep.getService().getServiceInfo();
+        } catch (EndpointException e) {
+            throw new ServiceConstructionException(e);
+        } catch (BusException e) {
+            throw new ServiceConstructionException(e);
+        }
+    }
+
+    public File getOutputFile() {
+        return null;
+    }
+}
+

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java (added)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java Tue Feb  6 03:26:13 2007
@@ -0,0 +1,70 @@
+/**
+ * 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.java2wsdl.processor.internal;
+
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.java2wsdl.processor.FrontendFactory;
+
+public final class ServiceBuilderFactory {
+    private static ServiceBuilderFactory instance;
+    private Class serviceClass;
+    private FrontendFactory frontend;
+    
+    private ServiceBuilderFactory() {
+        frontend = FrontendFactory.getInstance();
+    }
+    
+    public static ServiceBuilderFactory getInstance() {
+        if (instance == null) {
+            instance = new ServiceBuilderFactory();
+        }
+        return instance;
+    }
+
+    public ServiceBuilder newBuilder() {
+        return newBuilder(getStyle());
+    }
+
+    public ServiceBuilder newBuilder(FrontendFactory.Style s) {
+        ServiceBuilder builder = null;
+        try {
+            String clzName = getBuilderClassName(s);
+            builder = (ServiceBuilder) Class.forName(clzName).newInstance();
+        } catch (Exception e) {
+            throw new ToolException("Can not find the ServiceBulider for style: " + s, e);
+        }
+        builder.setServiceClass(serviceClass);
+        return builder;
+    }
+
+    protected String getBuilderClassName(FrontendFactory.Style s) {
+        String pkgName = getClass().getPackage().getName();
+        return pkgName + "." + s.toString().toLowerCase() + "." + s + "ServiceBuilder";
+    }
+
+    public FrontendFactory.Style getStyle() {
+        frontend.setServiceClass(this.serviceClass);
+        return frontend.discoverStyle();
+    }
+
+    public void setServiceClass(Class c) {
+        this.serviceClass = c;
+    }
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ClassProcessor.java (from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ClassProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ClassProcessor.java?view=diff&rev=504085&p1=incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ClassProcessor.java&r1=503552&p2=incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ClassProcessor.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ClassProcessor.java (original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ClassProcessor.java Tue Feb  6 03:26:13 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.java2wsdl.processor.internal;
+package org.apache.cxf.tools.java2wsdl.processor.internal.jaxws;
 
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
@@ -40,12 +40,11 @@
 import org.apache.cxf.tools.common.WSDLConstants;
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.WSDLModel;
-import org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor;
 import org.apache.cxf.tools.util.AnnotationUtil;
 import org.apache.cxf.tools.util.URIParserUtil;
 
 public class ClassProcessor {
-    private static final Logger LOG = LogUtils.getL7dLogger(JavaToWSDLProcessor.class);
+    private static final Logger LOG = LogUtils.getL7dLogger(ClassProcessor.class);
 
     Class<?> seiClass;
 

Copied: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocBareMethodProcessor.java (from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DocBareMethodProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocBareMethodProcessor.java?view=diff&rev=504085&p1=incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DocBareMethodProcessor.java&r1=503552&p2=incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocBareMethodProcessor.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DocBareMethodProcessor.java (original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocBareMethodProcessor.java Tue Feb  6 03:26:13 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.java2wsdl.processor.internal;
+package org.apache.cxf.tools.java2wsdl.processor.internal.jaxws;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.GenericArrayType;

Copied: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocWrapperMethodProcessor.java (from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DocWrapperMethodProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocWrapperMethodProcessor.java?view=diff&rev=504085&p1=incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DocWrapperMethodProcessor.java&r1=503552&p2=incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocWrapperMethodProcessor.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DocWrapperMethodProcessor.java (original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocWrapperMethodProcessor.java Tue Feb  6 03:26:13 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.java2wsdl.processor.internal;
+package org.apache.cxf.tools.java2wsdl.processor.internal.jaxws;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.GenericArrayType;

Added: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilder.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilder.java (added)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilder.java Tue Feb  6 03:26:13 2007
@@ -0,0 +1,48 @@
+/**
+ * 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.java2wsdl.processor.internal.jaxws;
+
+import java.io.File;
+import javax.jws.WebService;
+
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
+import org.apache.cxf.tools.java2wsdl.processor.internal.ServiceBuilder;
+import org.apache.cxf.tools.util.AnnotationUtil;
+
+public class JaxwsServiceBuilder extends ServiceBuilder {
+    
+    public JaxwsServiceBuilder() {
+        super();
+        setServiceFactory(new JaxWsServiceFactoryBean());
+    }
+
+    public File getOutputFile() {
+        WebService webService = AnnotationUtil.getPrivClassAnnotation(getServiceClass(), WebService.class);
+        if (webService == null) {
+            return null;
+        }
+        String wsdlLocation = webService.wsdlLocation();
+        if (!StringUtils.isEmpty(wsdlLocation)) {
+            return new File(wsdlLocation);
+        }
+        return super.getOutputFile();
+    }
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties (added)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties Tue Feb  6 03:26:13 2007
@@ -0,0 +1,2 @@
+LOAD_WRAPPER_CLASS_FAILED = Can not load wrapper class {0}, please check the @RequestWrapper or @ResponseWrapper and also check the clas is in your classpath
+SOAPBinding_RPC_ON_METHOD = Method [{0}] processing error : SOAPBinding annotation can not be placed on method with RPC style 
\ No newline at end of file

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RPCMethodProcessor.java (from r503552, incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/RPCMethodProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RPCMethodProcessor.java?view=diff&rev=504085&p1=incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/RPCMethodProcessor.java&r1=503552&p2=incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RPCMethodProcessor.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/RPCMethodProcessor.java (original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RPCMethodProcessor.java Tue Feb  6 03:26:13 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.java2wsdl.processor.internal;
+package org.apache.cxf.tools.java2wsdl.processor.internal.jaxws;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.GenericArrayType;

Added: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java (added)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java Tue Feb  6 03:26:13 2007
@@ -0,0 +1,35 @@
+/**
+ * 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.java2wsdl.processor.internal.jaxws;
+
+public class Wrapper {
+    protected String className;
+    protected String localName;
+    protected String targetNamespace;
+
+    public Wrapper() {
+    }
+
+    public Wrapper(String clz, String name, String ns) {
+        this.className = clz;
+        this.localName = name;
+        this.targetNamespace = ns;
+    }
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtil.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtil.java (added)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtil.java Tue Feb  6 03:26:13 2007
@@ -0,0 +1,90 @@
+/**
+ * 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.java2wsdl.processor.internal.jaxws;
+
+import java.lang.reflect.Method;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.tools.util.AnnotationUtil;
+
+public final class WrapperUtil {
+
+    private static final Logger LOG = LogUtils.getL7dLogger(WrapperUtil.class);
+    private WrapperUtil() {
+    }
+
+    public static Wrapper getRequestWrapper(Method method) {
+        RequestWrapper reqWrapper = method.getAnnotation(RequestWrapper.class);
+        String reqClassName = "";
+        String reqName = method.getName();
+        String reqNS = null;
+        if (reqWrapper != null && !StringUtils.isEmpty(reqWrapper.className())) {
+            reqClassName = reqWrapper.className().length() > 0 ? reqWrapper.className() : reqClassName;
+            reqName = reqWrapper.localName().length() > 0 ? reqWrapper.localName() : reqName;
+            reqNS = reqWrapper.targetNamespace();
+        } else {
+            reqClassName = getPackageName(method) + ".jaxws." + AnnotationUtil.capitalize(method.getName());
+        }
+        return new Wrapper(reqClassName, reqName, reqNS);
+    }
+
+    public static Wrapper getResponseWrapper(Method method) {
+        ResponseWrapper resWrapper = method.getAnnotation(ResponseWrapper.class);
+        String resClassName = "";
+        // rule 3.5 suffix -"Response"
+        String resName = method.getName() + "Response";
+        String resNS = null;
+        if (resWrapper != null && !StringUtils.isEmpty(resWrapper.className())) {
+            resClassName = resWrapper.className();
+            resName = resWrapper.localName().length() > 0 ? resWrapper.localName() : resName;
+            resNS = resWrapper.targetNamespace();
+        } else {
+            resClassName = getPackageName(method) + ".jaxws." 
+                + AnnotationUtil.capitalize(method.getName())
+                + "Response";
+        }
+        return new Wrapper(resClassName, resName, resNS);
+    }
+
+    public static boolean isWrapperClassExists(Method method) {
+        Wrapper requestWrapper = getRequestWrapper(method);
+        Wrapper responseWrapper = getResponseWrapper(method);
+        try {
+            AnnotationUtil.loadClass(requestWrapper.className, WrapperUtil.class.getClassLoader());
+            AnnotationUtil.loadClass(responseWrapper.className, WrapperUtil.class.getClassLoader());
+        } catch (Exception e) {
+            Message msg = new Message("LOAD_WRAPPER_CLASS_FAILED", LOG);
+            LOG.log(Level.WARNING, msg.toString());
+            return false;
+        }
+        return true;
+    }
+
+    private static String getPackageName(Method method) {
+        return method.getDeclaringClass().getPackage().getName();
+    }
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtil.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message