cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r492445 [1/2] - in /incubator/cxf/trunk: rt/core/src/main/java/org/apache/cxf/wsdl11/ tools2/wsdlto/ tools2/wsdlto/core/ tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/ tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsd...
Date Thu, 04 Jan 2007 08:29:18 GMT
Author: ema
Date: Thu Jan  4 00:29:16 2007
New Revision: 492445

URL: http://svn.apache.org/viewvc?view=rev&rev=492445
Log: (empty)

Added:
    incubator/cxf/trunk/tools2/wsdlto/test/
    incubator/cxf/trunk/tools2/wsdlto/test/pom.xml   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/
    incubator/cxf/trunk/tools2/wsdlto/test/src/main/
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/WSDLToJavaTest.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/WSDLVersionTest.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/core/
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml   (with props)
Removed:
    incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/
Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    incubator/cxf/trunk/tools2/wsdlto/core/pom.xml
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java
    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/WSDLVersion.java
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.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/Messages.properties
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/WSDLToProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml
    incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml
    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/JAXWSContainer.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfile.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/CustomizationParser.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBinding.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBindingParser.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSParameter.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/Messages.properties
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/PortTypeProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/ParameterMapper.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/DummyDataBinding.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfileTest.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtilTest.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/binding2.xml
    incubator/cxf/trunk/tools2/wsdlto/pom.xml

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=492445&r1=492444&r2=492445
==============================================================================
--- 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 Thu Jan  4 00:29:16 2007
@@ -60,6 +60,9 @@
             wsdlFactory = WSDLFactory.newInstance();
             registry = wsdlFactory.newPopulatedExtensionRegistry();
             registerInitialExtensions();
+            wsdlReader = wsdlFactory.newWSDLReader();
+            // TODO enable the verbose if in verbose mode.
+            wsdlReader.setFeature("javax.wsdl.verbose", false);
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
@@ -72,9 +75,7 @@
 
     protected void parseWSDL(String wsdlURL) {
         try {            
-            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, 

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java Thu Jan  4 00:29:16 2007
@@ -325,6 +325,7 @@
 
     public void buildInterface(ServiceInfo si, PortType p) {
         InterfaceInfo inf = si.createInterface(p.getQName());
+        this.copyExtensors(inf, p.getExtensibilityElements());
         inf.setProperty(WSDL_PORTTYPE, p);
         for (Operation op : cast(p.getOperations(), Operation.class)) {
             buildInterfaceOperation(inf, op);
@@ -337,7 +338,7 @@
         OperationInfo opInfo = inf.addOperation(new QName(inf.getName().getNamespaceURI(), op.getName()));
         opInfo.setProperty(WSDL_OPERATION, op);
         opInfo.setParameterOrdering(op.getParameterOrdering());
-        
+        this.copyExtensors(opInfo, op.getExtensibilityElements());
         Input input = op.getInput();
         List paramOrder = op.getParameterOrdering();
         if (input != null) {
@@ -526,7 +527,7 @@
     private void buildMessage(AbstractMessageContainer minfo, Message msg, List paramOrder) {
         XmlSchemaCollection schemas = (XmlSchemaCollection)minfo.getOperation().getInterface().getService()
             .getProperty(WSDL_SCHEMA_LIST);
-        
+               
         List orderedParam = msg.getOrderedParts(paramOrder);
         for (Part part : cast(orderedParam, Part.class)) {
             MessagePartInfo pi = minfo.addMessagePart(new QName(minfo.getName().getNamespaceURI(), 

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=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/pom.xml (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/pom.xml Thu Jan  4 00:29:16 2007
@@ -126,6 +126,8 @@
 	    <version>1.0.4</version>
 	</dependency>
 -->
+        
+
     </dependencies>
 
     <build>

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java Thu Jan  4 00:29:16 2007
@@ -64,14 +64,17 @@
         
         FrontEndProfile frontend = loadFrontEnd(getFrontEndName(args));
         context.put(FrontEndProfile.class, frontend);
-        
+               
         DataBindingProfile databinding = loadDataBinding(getDataBindingName(args));
+        
+      
+        
         context.put(DataBindingProfile.class, databinding);
         
         Class containerClass = frontend.getContainerClass();
 
         InputStream toolspecStream = getResourceAsStream(containerClass, frontend.getToolspec());
-        
+         
         ToolRunner.runTool(containerClass,
                            toolspecStream,
                            false,
@@ -129,7 +132,7 @@
     }
 
     public void setArguments(String[] pargs) {
-        this.args = pargs;
+        args = pargs;
     }
 
     public static void main(String[] pargs) {

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=492445&r1=492444&r2=492445
==============================================================================
--- 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 Thu Jan  4 00:29:16 2007
@@ -27,6 +27,7 @@
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
+
 import javax.wsdl.Definition;
 import javax.xml.namespace.QName;
 
@@ -34,11 +35,7 @@
 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;
 import org.apache.cxf.tools.common.ToolException;
@@ -46,10 +43,7 @@
 import org.apache.cxf.tools.common.toolspec.parser.BadUsageException;
 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;
 
 public class WSDLToJavaContainer extends AbstractCXFToolContainer {
 
@@ -61,19 +55,19 @@
         this.toolName = name;
     }
 
-    protected Set<String> getArrayKeys() {
+    public Set<String> getArrayKeys() {
         Set<String> set = new HashSet<String>();
         set.add(ToolConstants.CFG_PACKAGENAME);
         set.add(ToolConstants.CFG_NEXCLUDE);
         return set;
     }
 
-    private ToolConstants.WSDLVersion getWSDLVersion() {
+    public ToolConstants.WSDLVersion getWSDLVersion() {
         String version = (String) context.get(ToolConstants.CFG_WSDL_VERSION);
         return WSDLVersion.getVersion(version);
     }
 
-    private Bus getBus() {
+    public Bus getBus() {
         return BusFactoryHelper.newInstance().getDefaultBus();
     }
     
@@ -81,7 +75,7 @@
     public void execute(boolean exitOnFinish) throws ToolException {
         try {
             super.execute(exitOnFinish);
-            if (!hasInfoOption()) {
+            /*if (!hasInfoOption()) {
                 buildToolContext();
                 validate(context);
                 
@@ -103,6 +97,9 @@
                         builder.validate(definition);
                     }
                     
+                    
+                    //to do .., We need to customized the definition
+                    
                     if (context.optionSet(ToolConstants.CFG_BINDING)) {
                         builder.setContext(context);
                         builder.customize();
@@ -115,6 +112,7 @@
                 }
 
                 // Generate types
+                
                 generateTypes();                
 
                 // Build the JavaModel from the ServiceModel
@@ -137,6 +135,7 @@
                     removeExcludeFiles();
                 }
             }
+            */
         } catch (ToolException ex) {
             if (ex.getCause() instanceof BadUsageException) {
                 getInstance().printUsageException(toolName, (BadUsageException)ex.getCause());
@@ -155,7 +154,7 @@
     }
 
     @SuppressWarnings("unchecked")    
-    private QName getServiceQName(Definition definition) {
+    public QName getServiceQName(Definition definition) {
         QName qname = context.getQName(ToolConstants.CFG_SERVICENAME);
         if (qname == null) {
             qname = (QName) definition.getServices().keySet().iterator().next();
@@ -172,7 +171,7 @@
         return qname;
     }
 
-    private void loadDefaultNSPackageMapping(ToolContext env) {
+    public void loadDefaultNSPackageMapping(ToolContext env) {
         if (!env.hasExcludeNamespace(DEFAULT_NS2PACKAGE) 
             && env.getBooleanValue(ToolConstants.CFG_DEFAULT_NS, "true")) {
             env.loadDefaultNS2Pck(getResourceAsStream("namespace2package.cfg"));
@@ -183,7 +182,7 @@
     }
 
 
-    private void setExcludePackageAndNamespaces(ToolContext env) {
+    public void setExcludePackageAndNamespaces(ToolContext env) {
         if (env.get(ToolConstants.CFG_NEXCLUDE) != null) {
             String[] pns = (String[])env.get(ToolConstants.CFG_NEXCLUDE);
             for (int j = 0; j < pns.length; j++) {
@@ -200,7 +199,7 @@
         }
     }
     
-    private void setPackageAndNamespaces(ToolContext env) {
+    public void setPackageAndNamespaces(ToolContext env) {
         if (env.get(ToolConstants.CFG_PACKAGENAME) != null) {
             String[] pns = (String[])env.get(ToolConstants.CFG_PACKAGENAME);
             for (int j = 0; j < pns.length; j++) {
@@ -247,7 +246,7 @@
         }
     }
 
-    protected void setAntProperties(ToolContext env) {
+    public void setAntProperties(ToolContext env) {
         String installDir = System.getProperty("install.dir");
         if (installDir != null) {
             env.put(ToolConstants.CFG_INSTALL_DIR, installDir);
@@ -267,7 +266,7 @@
         env.put(ToolConstants.CFG_ANT_PROP, props);
     }
 
-    private void buildToolContext() {
+    public void buildToolContext() {
         context = getContext();
         context.addParameters(getParametersMap(getArrayKeys()));
 
@@ -280,6 +279,10 @@
             setLibraryReferences(context);
         }
         
+        if (!context.containsKey(ToolConstants.CFG_WSDL_VERSION)) {
+            context.put(ToolConstants.CFG_WSDL_VERSION, WSDLVersion.WSDL11);
+        }
+        
         if (isVerboseOn()) {
             context.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
         }
@@ -290,7 +293,7 @@
         setPackageAndNamespaces(context);
     }
 
-    private static InputStream getResourceAsStream(String file) {
+    protected static InputStream getResourceAsStream(String file) {
         return WSDLToJavaContainer.class.getResourceAsStream(file);
     }
 
@@ -306,7 +309,7 @@
         }
     }
 
-    private void removeExcludeFiles() throws IOException {
+    public void removeExcludeFiles() throws IOException {
         List<String> excludeGenFiles = context.getExcludeFileList();
         if (excludeGenFiles == null) {
             return;
@@ -357,10 +360,10 @@
         return false;
     }
     
-    private void generateTypes() throws ToolException {
+    public void generateTypes() throws ToolException {
         if (passthrough()) {
             return;
         }
-        context.get(DataBindingProfile.class).generate(context);
+        context.get(DataBindingProfile.class).generate();
     }
 }

Modified: 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/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLVersion.java?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLVersion.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLVersion.java Thu Jan  4 00:29:16 2007
@@ -23,8 +23,8 @@
 
 public final class WSDLVersion {
 
-    private static final String WSDL11 = "1.1";
-    private static final String WSDL20 = "2.0";
+    public static final String WSDL11 = "1.1";
+    public static final String WSDL20 = "2.0";
 
     private WSDLVersion() {
     }

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.java?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.java Thu Jan  4 00:29:16 2007
@@ -19,18 +19,19 @@
 
 package org.apache.cxf.tools.wsdlto.core;
 
-import java.util.List;
 
 import javax.xml.namespace.QName;
 
-import com.sun.tools.xjc.api.Property;
-import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 
 public interface DataBindingProfile {
-    void generate(ToolContext context) throws ToolException;
-    String getType(QName qn, boolean fullName);
-    String getJavaType(QName qn, boolean boxify);
-    List<? extends Property> getBlock(MessagePartInfo part);
+    
+    void initialize(ToolContext context);
+      
+    void generate() throws ToolException;
+
+    String getType(QName qn);
+    //String getJavaType(QName qn, boolean boxify);
+    //List<? extends Property> getBlock(MessagePartInfo part);
 }

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=492445&r1=492444&r2=492445
==============================================================================
--- 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 Thu Jan  4 00:29:16 2007
@@ -67,7 +67,7 @@
         this.builder = b;
     }
 
-    public AbstractWSDLBuilder<? extends Object> getWSDLBuilder() {
+    public AbstractWSDLBuilder getWSDLBuilder() {
         return builder;
     }
 

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/Messages.properties?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/Messages.properties (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/Messages.properties Thu Jan  4 00:29:16 2007
@@ -15,3 +15,6 @@
 FOUND_DATABINDINGS =  Found {1} databindings in <{0}> plugin.
 LOADING_DATABINDING = Loading <{0}> databinding from <{1}> plugin.
 DATABINDING_MISSING_NAME = Databinding must have a name, can not load THIS databinding from <{0}> plugin.
+
+NO_SERVICE_IN_DEFINITION = There is no service in this wsdl : {0}
+CAN_NOT_FIND_SERVICE = Can not find the service : {0} in wsdl :{1}
\ No newline at end of file

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=492445&r1=492444&r2=492445
==============================================================================
--- 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 Thu Jan  4 00:29:16 2007
@@ -37,7 +37,7 @@
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.plugin.DataBinding;
 import org.apache.cxf.tools.plugin.FrontEnd;
-import org.apache.cxf.tools.plugin.Generator;
+//import org.apache.cxf.tools.plugin.Generator;
 import org.apache.cxf.tools.plugin.Plugin;
 
 public final class PluginLoader {
@@ -137,6 +137,7 @@
 
     public FrontEnd getFrontEnd(String name) {
         FrontEnd frontend = frontends.get(name);
+        
         if (frontend == null) {
             // TODO: If null, we should search the whole classpath, to load all the plugins,
             //       otherwise throws Exception
@@ -146,7 +147,7 @@
         return frontend;
     }
 
-    private String getGeneratorClass(FrontEnd frontend, Generator generator) {
+   /* private String getGeneratorClass(FrontEnd frontend, Generator generator) {
         String fullPackage = generator.getPackage();
         if (StringUtils.isEmpty(fullPackage)) {
             fullPackage = frontend.getGenerators().getPackage();
@@ -155,29 +156,32 @@
             fullPackage = frontend.getPackage();
         }
         return fullPackage + "." + generator.getName();
-    }
+    }*/
     
     private List<FrontEndGenerator> getFrontEndGenerators(FrontEnd frontend) {
         List<FrontEndGenerator> generators = new ArrayList<FrontEndGenerator>();
 
-        String fullClzName = null;
-        try {
+        //String fullClzName = null;
+       /* try {
             for (Generator generator : frontend.getGenerators().getGenerator()) {
                 fullClzName = getGeneratorClass(frontend, generator);
-                generators.add((FrontEndGenerator)Class.forName(fullClzName).newInstance());
+                Class clz = this.getClass().getClassLoader().loadClass(fullClzName);
+                generators.add((FrontEndGenerator)clz.newInstance());
             }
         } catch (Exception e) {
             LOG.log(Level.SEVERE, "FRONTEND_PROFILE_LOAD_FAIL", fullClzName);
             Message msg = new Message("FRONTEND_PROFILE_LOAD_FAIL", LOG, fullClzName);
             throw new ToolException(msg, e);
-        }
+        }*/
+        
         return generators;
     }
 
-    private FrontEndProfile loadFrontEndProfile(String fullClzName) {
+    private FrontEndProfile loadFrontEndProfile(String fullClzName) {       
         FrontEndProfile profile = null;
         try {
-            profile = (FrontEndProfile) Class.forName(fullClzName).newInstance();
+            Class clz = getClass().getClassLoader().loadClass(fullClzName);
+            profile = (FrontEndProfile)clz.newInstance();
         } catch (Exception e) {
             LOG.log(Level.SEVERE, "FRONTEND_PROFILE_LOAD_FAIL", fullClzName);
             Message msg = new Message("FRONTEND_PROFILE_LOAD_FAIL", LOG, fullClzName);
@@ -266,7 +270,9 @@
     public FrontEndProfile getFrontEndProfile(String name) {
         FrontEndProfile profile = frontendProfiles.get(name);
         if (profile == null) {
+           
             FrontEnd frontend = getFrontEnd(name);
+           
             profile = loadFrontEndProfile(getFrontEndProfileClass(frontend));
 
             for (FrontEndGenerator generator : getFrontEndGenerators(frontend)) {

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/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=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/WSDLToProcessor.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/WSDLToProcessor.java Thu Jan  4 00:29:16 2007
@@ -27,12 +27,10 @@
 import java.util.logging.Logger;
 
 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.util.ClassCollector;
 import org.apache.cxf.tools.util.FileWriterUtil;
 import org.apache.velocity.app.Velocity;
 
@@ -115,8 +113,7 @@
     }
 
     private void init() throws ToolException {
-        initVelocity();
-        context.put(ClassCollector.class, new ClassCollector());
+        initVelocity();    
     }
 
     public void process() throws ToolException {
@@ -131,7 +128,5 @@
         return this.context;
     }
     
-    public ServiceInfo getServiceInfo() {
-        return context.get(ServiceInfo.class);
-    }
+   
 }

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml Thu Jan  4 00:29:16 2007
@@ -19,10 +19,14 @@
 -->
 
 <plugin name="default" version="" provider="" xmlns="http://cxf.apache.org/tools/plugin">
-    <frontend name="" package="" profile="">
-	<generators>
+    <frontend name="jaxws" package="org.apache.cxf.tools.wsdlto.frontend.jaxws" profile="JAXWSProfile">
+	<container name="JAXWSContainer" toolspec="jaxws-toolspec.xml"/>
+	<processor name="WSDLToJavaProcessor" package="org.apache.cxf.tools.wsdlto.frontend.jaxws.processor"/>
+	<builder name="JAXWSDefinitionBuilder" package="org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11"/>
+	<!--generators package="">
 	    <generator name=""/>
-	</generators>
-    </frontend>	
-    <databinding name="" package="" profile=""/>
+	    <generator name=""/>
+	</generators-->
+    </frontend>
+    <databinding name="jaxb" package="org.apache.cxf.tools.wsdlto.databinding.jaxb" profile="JAXBDataBinding"/>
 </plugin>

Modified: incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml (original)
+++ incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml Thu Jan  4 00:29:16 2007
@@ -34,5 +34,65 @@
     <properties>
         <topDirectoryLocation>../../../</topDirectoryLocation>
     </properties>
+    
+    <dependencies>
+     <dependency>
+                 <groupId>com.sun.xml.bind</groupId>
+                 <artifactId>jaxb-xjc</artifactId>
+             </dependency>
+             <dependency>
+                 <groupId>com.sun.xml.bind</groupId>
+                 <artifactId>jaxb-impl</artifactId>
+     </dependency>
+     
+     <dependency>
+     	    <groupId>junit</groupId>
+     	    <artifactId>junit</artifactId>
+     	    <scope>test</scope>
+     	</dependency>
+     	<dependency>
+     	    <groupId>org.apache.cxf</groupId>
+     	    <artifactId>cxf-tools-common</artifactId>
+     	    <version>${project.version}</version>
+     	</dependency>
+     
+     	<dependency>
+     	    <groupId>org.apache.cxf</groupId>
+     	    <artifactId>cxf-tools-wsdl2java</artifactId>
+     	    <version>${project.version}</version>
+     	</dependency>
+     
+     	<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>
+     
+             <dependency>
+                 <groupId>org.apache.cxf</groupId>
+                 <artifactId>cxf-rt-bindings-xml</artifactId>
+                 <version>${project.version}</version>
+             </dependency>
+     
+     	<dependency>
+     	    <groupId>org.apache.cxf</groupId>
+     	    <artifactId>cxf-rt-transports-jms</artifactId>
+                 <version>${project.version}</version>
+             </dependency>
+     
+     	<dependency>
+     	    <groupId>org.apache.cxf</groupId>
+     	    <artifactId>cxf-tools2-wsdlto-core</artifactId>
+     	    <version>${project.version}</version>
+	</dependency>
+        
+        
+    </dependencies>
 
 </project>

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=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml Thu Jan  4 00:29:16 2007
@@ -82,6 +82,14 @@
 	    <artifactId>cxf-tools2-wsdlto-core</artifactId>
 	    <version>${project.version}</version>
 	</dependency>
+	
+	 
+	 <dependency>
+	 	    <groupId>org.apache.cxf</groupId>
+	 	    <artifactId>cxf-tools2-wsdlto-databinding-jaxb</artifactId>
+	 	    <version>${project.version}</version>
+	</dependency>
+	 
 
     </dependencies>
 </project>

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSContainer.java?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSContainer.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSContainer.java Thu Jan  4 00:29:16 2007
@@ -20,14 +20,28 @@
 package org.apache.cxf.tools.wsdlto.frontend.jaxws;
 
 import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.Set;
 
+import javax.wsdl.Definition;
+
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.service.model.ServiceInfo;
+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;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.toolspec.ToolSpec;
+import org.apache.cxf.tools.common.toolspec.parser.BadUsageException;
+import org.apache.cxf.tools.util.ClassCollector;
 import org.apache.cxf.tools.wsdlto.WSDLToJavaContainer;
+import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
+import org.apache.cxf.tools.wsdlto.core.FrontEndProfile;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder;
+import org.apache.cxf.wsdl11.WSDLServiceBuilder;
 
 public class JAXWSContainer extends WSDLToJavaContainer {
     
@@ -37,7 +51,7 @@
         super(TOOL_NAME, toolspec);
     }
 
-    protected Set<String> getArrayKeys() {
+    public Set<String> getArrayKeys() {
         Set<String> set = super.getArrayKeys();
         set.add(ToolConstants.CFG_BINDING);
         return set;
@@ -45,19 +59,142 @@
 
     public void validate(ToolContext env) throws ToolException {
         super.validate(env);
-        
+        File tmpfile = new File("");
         if (env.containsKey(ToolConstants.CFG_BINDING)) {
             String[] bindings = (String[])env.get(ToolConstants.CFG_BINDING);
-            for (int i = 0; i < bindings.length; i++) {
-                File binding = new File(bindings[i]);
-                if (!binding.exists()) {
-                    Message msg = new Message("FILE_NOT_EXIST", LOG, binding);
+            for (int i = 0; i < bindings.length; i++) {               
+                
+                File bindingFile = null;
+                //= new File(bindings[i]);
+                try {
+                    URI bindingURI = new URI(bindings[i]);
+                    if (!bindingURI.isAbsolute()) {
+                        bindingURI = tmpfile.toURI().resolve(bindingURI);
+                    }
+                    bindingFile = new File(bindingURI);
+                } catch (URISyntaxException e) {
+                    bindingFile = new File(bindings[i]);
+                }
+                bindings[i] = bindingFile.toURI().toString();
+                if (!bindingFile.exists()) {
+                    Message msg = new Message("FILE_NOT_EXIST", LOG, bindings[i]);
                     throw new ToolException(msg);
-                } else if (binding.isDirectory()) {
-                    Message msg = new Message("NOT_A_FILE", LOG, binding);
+                } else if (bindingFile.isDirectory()) {
+                    Message msg = new Message("NOT_A_FILE", LOG, bindings[i]);
                     throw new ToolException(msg);
                 }
             }
+            env.put(ToolConstants.CFG_BINDING, bindings);
+        }
+        
+        String wsdl = (String)env.get(ToolConstants.CFG_WSDLURL);
+        
+        File wsdlFile = null;
+        try {
+            URI wsdlURI = new URI(wsdl);
+            if (!wsdlURI.isAbsolute()) {
+                wsdlURI = tmpfile.toURI().resolve(wsdlURI);
+            }
+            wsdlFile = new File(wsdlURI);
+        } catch (URISyntaxException e) {
+            wsdlFile = new File(wsdl);
         }
+        if (!wsdlFile.exists()) {
+            Message msg = new Message("FILE_NOT_EXIST", LOG, wsdl);
+            throw new ToolException(msg);
+        } else if (wsdlFile.isDirectory()) {
+            Message msg = new Message("NOT_A_FILE", LOG, wsdl);
+            throw new ToolException(msg);
+        }
+        env.put(ToolConstants.CFG_WSDLURL, wsdlFile.toURI().toString());        
     }
+    
+    public void execute(boolean exitOnFinish) throws ToolException {
+        try {           
+            super.execute(exitOnFinish);
+            if (!hasInfoOption()) {
+                
+                buildToolContext();
+                validate(context);
+                
+                context.put(ClassCollector.class, new ClassCollector());
+                
+                FrontEndProfile frontend = context.get(FrontEndProfile.class);
+                
+                Processor processor = frontend.getProcessor();
+                
+                ToolConstants.WSDLVersion version = getWSDLVersion();
+                System.out.println("---version ---- " + version);
+                
+                ServiceInfo service = null;
+                    
+                // Build the ServiceModel from the WSDLModel
+                if (version == ToolConstants.WSDLVersion.WSDL11) {
+                   
+                    JAXWSDefinitionBuilder  builder = 
+                        (JAXWSDefinitionBuilder)frontend.getWSDLBuilder();
+                    builder.setContext(context);
+                    builder.build();
+                    builder.customize();
+                    context.put(ToolConstants.NS_JAXB_BINDINGS, 
+                                builder.getJaxbBindings());                     
+                    context.put(ToolConstants.HANDLER_CHAIN, builder.getHandlerChain());
+                    //get the definition after customized
+                    Definition definition = builder.getDefinition();
+                    builder.validate(definition);
+                    context.put(Definition.class, definition);
+                    
+                    
+                    //get serviceInfo
+                    WSDLServiceBuilder serviceBuilder = new WSDLServiceBuilder(getBus());
+                    service = serviceBuilder.buildService(definition, getServiceQName(definition));
+                    context.put(ServiceInfo.class, service);
+                    
+                } else {
+                    // TODO: wsdl2.0 support
+                }
+                
+                
+                //initialize databinding
+                DataBindingProfile databinding = (DataBindingProfile)context.get(DataBindingProfile.class);
+                databinding.initialize(context);
+                                
+                generateTypes();                
+                // Build the JavaModel from the ServiceModel
+                processor.setEnvironment(context);
+                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) {
+                getInstance().printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
+            }
+            System.err.println();
+            if (isVerboseOn()) {
+                ex.printStackTrace();
+            }
+        } catch (Exception ex) {
+            System.err.println("Error : " + ex.getMessage());
+            System.err.println();
+            if (isVerboseOn()) {
+                ex.printStackTrace();
+            }
+        }
+    }
+
+    
+    
 }

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfile.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfile.java?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfile.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfile.java Thu Jan  4 00:29:16 2007
@@ -23,5 +23,5 @@
 //import org.apache.cxf.tools.wsdlto.core.FrontEndGenerator;
 
 public class JAXWSProfile extends FrontEndProfile {
-    // empty
+    
 }

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/CustomizationParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/CustomizationParser.java?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/CustomizationParser.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/CustomizationParser.java Thu Jan  4 00:29:16 2007
@@ -19,30 +19,19 @@
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.customiztion;
 
 import java.io.File;
-import java.io.IOException;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 import java.util.logging.Logger;
 
-import javax.wsdl.Definition;
-import javax.wsdl.Operation;
-import javax.wsdl.PortType;
-import javax.wsdl.WSDLException;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.schema.Schema;
 import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.xpath.XPath;
@@ -55,10 +44,7 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import org.xml.sax.ErrorHandler;
 import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
@@ -79,19 +65,12 @@
     private final XPath xpath = XPF.newXPath();
 
     private ToolContext env;
-    private final Map<URI, Element> jaxwsBindings = new HashMap<URI, Element>();
+    private final List<Element> jaxwsBindings = new ArrayList<Element>();
     private final Set<InputSource> jaxbBindings = new HashSet<InputSource>();
-    private final Map<String, JAXWSBinding> definitionBindingMap = new HashMap<String, JAXWSBinding>();
-    private final Map<QName, JAXWSBinding> portTypeBindingMap = new HashMap<QName, JAXWSBinding>();
-    private final Map<QName, JAXWSBinding> opertaionBindingMap = new HashMap<QName, JAXWSBinding>();
-    private final Map<QName, JAXWSBinding> partBindingMap = new HashMap<QName, JAXWSBinding>();
-
-    private Definition definition;
-
-    private Element handlerChains;
-    private Element wsdlNode;;
     
-    private Element customizedWSDLNode;
+    private Element handlerChains;
+    private Element wsdlNode;
+    private String wsdlURL;
 
     private CustomizationParser() {
 
@@ -106,10 +85,6 @@
     }
 
     public void clean() {
-        definitionBindingMap.clear();
-        portTypeBindingMap.clear();
-        opertaionBindingMap.clear();
-        partBindingMap.clear();
         jaxwsBindings.clear();
         jaxbBindings.clear();
     }
@@ -122,7 +97,12 @@
         this.env = pe;
         String[] bindingFiles;
         try {
+            this.wsdlURL = (String)env.get(ToolConstants.CFG_WSDLURL);           
+            this.wsdlNode = this.getTargetNode(wsdlURL);
             bindingFiles = (String[])env.get(ToolConstants.CFG_BINDING);
+            if (bindingFiles == null) {
+                return;
+            }
         } catch (ClassCastException e) {
             bindingFiles = new String[1];
             bindingFiles[0] = (String)env.get(ToolConstants.CFG_BINDING);
@@ -137,41 +117,40 @@
             }
         }
 
-        for (URI wsdlUri : jaxwsBindings.keySet()) {
-            Element element = jaxwsBindings.get(wsdlUri);
-            definition = getWSDlDefinition(wsdlUri.toString());
-            URI uri = null;
-            try {
-                uri = new URI(definition.getDocumentBaseURI());
-            } catch (URISyntaxException e1) {
-                //ignore
-            }
-            wsdlNode = getTargetNode(uri);
-            buildTargetNodeMap(element, "");
+        for (Element element : jaxwsBindings) {
+            internalizeBinding(element, "");
         }
 
         buildHandlerChains();
     }
 
-    public Element getTargetNode(URI wsdlLoc) {
-
+    public Element getTargetNode(String wsdlLoc) {
         Document doc = null;
+        URI uri = null;
         try {
-            File file = new File(wsdlLoc);
-            java.io.InputStream ins = new java.io.FileInputStream(file);
-            doc = DOMUtils.readXml(ins);
-            
-        } catch (SAXException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (IOException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (ParserConfigurationException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
+            uri = new URI(wsdlLoc);
+        } catch (URISyntaxException e1) {
+           //ignore
+        }
+        File file = new File(uri);
+        InputStream ins;
+       
+        try {
+            ins = new FileInputStream(file);
+        } catch (FileNotFoundException e) {
+            Message msg = new Message("FILE_NOT_FOUND", LOG, new Object[] {file});
+            throw new ToolException(msg, e); 
         }
-
+            
+       
+        
+        try {
+            doc = DOMUtils.readXml(ins);
+        } catch (Exception e) {
+            Message msg = new Message("CAN_NOT_READ_AS_ELEMENT", LOG, new Object[] {file});
+            throw new ToolException(msg, e); 
+        } 
+   
         if (doc != null) {
             return doc.getDocumentElement();
         }
@@ -179,142 +158,124 @@
     }
 
     private void buildHandlerChains() {
-        /*
-         * for (Element jaxwsBinding : jaxwsBindings) { NodeList nl =
-         * jaxwsBinding.getElementsByTagNameNS(ToolConstants.HANDLER_CHAINS_URI,
-         * ToolConstants.HANDLER_CHAINS); if (nl.getLength() == 0) { continue; } //
-         * take the first one, anyway its 1 handler-config per customization
-         * this.handlerChains = (Element)nl.item(0); return; }
-         */
+
+        for (Element jaxwsBinding : jaxwsBindings) {
+            NodeList nl = jaxwsBinding.getElementsByTagNameNS(ToolConstants.HANDLER_CHAINS_URI,
+                                                              ToolConstants.HANDLER_CHAINS);
+            if (nl.getLength() == 0) {
+                continue;
+            }
+            // take the first one, anyway its 1 handler-config per customization
+            this.handlerChains = (Element)nl.item(0);
+            return;
+        }
+
     }
 
-    private void buildTargetNodeMap(Element bindings, String expression) {
+    private void internalizeBinding(Element bindings, String expression) {
         if (bindings.getAttributeNode("wsdlLocation") != null) {
             expression = "/";
         }
 
-        JAXWSBindingParser bindingsParser = new JAXWSBindingParser(definition.getExtensionRegistry());
-
         if (isGlobaleBindings(bindings)) {
+            Node node = queryXPathNode(wsdlNode, "//wsdl:definitions");
+            copyBindingsToWsdl(node, bindings);
+        }
 
-            try {
-                JAXWSBinding jaxwsBinding = bindingsParser.parse(Definition.class, bindings, definition
-                    .getTargetNamespace());
-                if (definitionBindingMap.containsKey(definition.getTargetNamespace())) {
-                    JAXWSBinding binding = definitionBindingMap.get(definition.getTargetNamespace());
-                    mergeJaxwsBinding(binding, jaxwsBinding);
-                } else {
-                    definitionBindingMap.put(definition.getTargetNamespace(), jaxwsBinding);
-                }
+        if (isJAXWSBindings(bindings) && bindings.getAttributeNode("node") != null) {
+            expression = expression + "/" + bindings.getAttribute("node");
+  
+            Node node = null;
+            boolean nestedJaxb = nestedJaxbBinding(bindings);
 
-            } catch (WSDLException e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
+            node = queryXPathNode(wsdlNode, expression);
+            if (node != null && !nestedJaxb) {
+                copyBindingsToWsdl(node, bindings);
             }
 
-        }
+            if (node != null && nestedJaxb) {
+                // append xmlns:jaxb and jaxb:version attribute for schema
+                Node schemaNode = getSchemaNode(node);
+                Element schemaElement = (Element)schemaNode;
 
-        if (isJAXWSParameter(bindings) && bindings.getAttribute("part") != null) {
-            String partExpression = "//" + bindings.getAttribute("part");
-            try {
-                Node node = evaluateBindingsNode(wsdlNode, partExpression);
+                String jaxbPrefix = schemaElement.lookupPrefix(ToolConstants.NS_JAXB_BINDINGS);
+                if (jaxbPrefix == null) {
+                    schemaElement.setAttribute("xmlns:jaxb", ToolConstants.NS_JAXB_BINDINGS);
+                    schemaElement.setAttribute("jaxb:version", "2.0");
+                }
 
-                if ("part".equals(node.getLocalName())) {
-                    JAXWSBinding jaxwsBinding = bindingsParser.parse(PortType.class, bindings,
-                                                                     getTargetNamspace(node));
-                    addJAXWSBindingMap(partBindingMap, node, jaxwsBinding);
+                // append jaxb appinfo for value node
+                Element annoElement = node.getOwnerDocument().createElementNS(ToolConstants.SCHEMA_URI,
+                                                                              "annotation");
+                Element appinfoEle = node.getOwnerDocument().createElementNS(ToolConstants.SCHEMA_URI,
+                                                                             "appinfo");
 
-                }
-            } catch (WSDLException we) {
-                Message msg = new Message("PARSE_BINDINGFILE_EXCEPTION", LOG);
-                throw new ToolException(msg, we);
-            }
-        }
+                annoElement.appendChild(appinfoEle);
 
-        if (isJAXWSBindings(bindings) && bindings.getAttributeNode("node") != null) {
-            expression = expression + "/" + bindings.getAttribute("node");
-            try {
-                Node node = null;
-                boolean nestedJaxb = nestedJaxbBinding(bindings);               
-                if (nestedJaxb) {
-                    customizedWSDLNode = 
-                        customizedWSDLNode == null ? getNodeInDefinition(definition) : customizedWSDLNode;
-                    node = evaluateBindingsNode(customizedWSDLNode, expression);
-                } else {
-                    node = evaluateBindingsNode(wsdlNode, expression);
-                }
-                if (node != null && "portType".equals(node.getLocalName()) && !nestedJaxb) {
-                    JAXWSBinding jaxwsBinding = bindingsParser.parse(PortType.class, bindings,
-                                                                     getTargetNamspace(node));
-                    addJAXWSBindingMap(portTypeBindingMap, node, jaxwsBinding);
-                }
+                NodeList jxbBinds = getJaxbBindingNode((Element)bindings);
 
-                if (node != null && "operation".equals(node.getLocalName()) && !nestedJaxb) {
-                    JAXWSBinding jaxwsBinding = bindingsParser.parse(Operation.class, bindings,
-                                                                     getTargetNamspace(node));
-                    addJAXWSBindingMap(opertaionBindingMap, node, jaxwsBinding);
+                for (int l = 0; l < jxbBinds.getLength(); l++) {
+                    Node jaxbBindingNode = jxbBinds.item(l);
+                    Node cloneNode = ProcessorUtil.cloneNode(node.getOwnerDocument(), jaxbBindingNode, true);
+                    appinfoEle.appendChild(cloneNode);
                 }
 
-                if (node != null && nestedJaxb) {
-                    // append xmlns:jaxb and jaxb:version attribute for schema
-                    Node schemaNode = getSchemaNode(node);
-                    Element schemaElement = (Element)schemaNode;
-                    
-                    String jaxbPrefix = schemaElement.lookupPrefix(ToolConstants.NS_JAXB_BINDINGS);
-                    if (jaxbPrefix == null) {
-                        schemaElement.setAttribute("xmlns:jaxb", ToolConstants.NS_JAXB_BINDINGS);
-                        schemaElement.setAttribute("jaxb:version", "2.0");
-                    }
-
-                    // append jaxb appinfo for value node
-                    Element annoElement = node.getOwnerDocument().createElementNS(ToolConstants.SCHEMA_URI,
-                                                                                  "annotation");
-                    Element appinfoEle = node.getOwnerDocument().createElementNS(ToolConstants.SCHEMA_URI,
-                                                                                 "appinfo");
-
-                    annoElement.appendChild(appinfoEle);
-
-                    NodeList jxbBinds = getJaxbBindingNode((Element)bindings);
-
-                    for (int l = 0; l < jxbBinds.getLength(); l++) {
-                        Node jaxbBindingNode = jxbBinds.item(l);
-                        Node cloneNode = ProcessorUtil.cloneNode(node.getOwnerDocument(), jaxbBindingNode,
-                                                                 true);
-                        appinfoEle.appendChild(cloneNode);
-                    }
-
-                    if (node.getChildNodes().getLength() > 0) {
-                        node.insertBefore(annoElement, node.getChildNodes().item(0));
-                    } else {
-                        node.appendChild(annoElement);
-                    }
+                if (node.getChildNodes().getLength() > 0) {
+                    node.insertBefore(annoElement, node.getChildNodes().item(0));
+                } else {
+                    node.appendChild(annoElement);
                 }
-
-            } catch (WSDLException we) {
-                Message msg = new Message("PARSE_BINDINGFILE_EXCEPTION", LOG);
-                throw new ToolException(msg, we);
             }
         }
 
         Element[] children = getChildElements(bindings, ToolConstants.NS_JAXWS_BINDINGS);
         for (int i = 0; i < children.length; i++) {
-            buildTargetNodeMap(children[i], expression);
+            internalizeBinding(children[i], expression);
         }
     }
-    @SuppressWarnings("unchecked")
-    private Element getNodeInDefinition(Definition def) {
-        List<ExtensibilityElement> extList = def.getTypes().getExtensibilityElements();
-        for (ExtensibilityElement ele : extList) {
-            if (ele instanceof Schema) {
-                Schema schema = (Schema)ele;
-                Element element = schema.getElement();
-                Element target = element.getOwnerDocument().getDocumentElement();
-                return target;
+
+    private void copyBindingsToWsdl(Node node, Node bindings) {
+        if (bindings.getNamespaceURI().equals(ToolConstants.JAXWS_BINDINGS.getNamespaceURI())) {
+            bindings.setPrefix("jaxws");
+        }
+
+        for (int i = 0; i < bindings.getChildNodes().getLength(); i++) {
+            Node childNode = bindings.getChildNodes().item(i);
+            if (childNode.getNodeType() == Element.ELEMENT_NODE
+                && childNode.getNamespaceURI().equals(ToolConstants.JAXWS_BINDINGS.getNamespaceURI())) {
+                childNode.setPrefix("jaxws");
             }
         }
-        return null;
+
+        Node cloneNode = ProcessorUtil.cloneNode(node.getOwnerDocument(), bindings, true);
+        Node firstChild = DOMUtils.getChild(node, "jaxws:bindings");
+        if (firstChild == null && cloneNode.getNodeName().indexOf("bindings") == -1) {
+            wsdlNode.setAttribute("xmlns:jaxws", ToolConstants.JAXWS_BINDINGS.getNamespaceURI());
+            Element jaxwsBindingElement = node.getOwnerDocument().createElement("jaxws:bindings");
+            node.appendChild(jaxwsBindingElement);
+            firstChild = jaxwsBindingElement;
+        } 
+        
+        if (firstChild == null && cloneNode.getNodeName().indexOf("bindings") > -1) {
+            firstChild = node;
+        }
+        
+        Element cloneEle = (Element)cloneNode;
+        cloneEle.removeAttribute("node");
+        for (int i = 0; i < cloneNode.getChildNodes().getLength(); i++) {
+            Node child = cloneNode.getChildNodes().item(i);
+            if (child.getNodeType() == Element.ELEMENT_NODE) {
+                Element childElement = (Element)child;
+                Node attrNode = childElement.getAttributeNode("node");
+                if (attrNode != null) {
+                    cloneNode.removeChild(child);
+                }
+
+            }
+        }
+        firstChild.appendChild(cloneNode);
     }
-    
+
     private Node getSchemaNode(Node node) {
         if (!"schema".equals(node.getLocalName())) {
             while (node.getParentNode() != null) {
@@ -329,21 +290,6 @@
         return node;
     }
 
-    @SuppressWarnings("unchecked")
-    public Definition getWSDlDefinition(String baseUrl) {
-        Definition def = (Definition)env.get(ToolConstants.WSDL_DEFINITION);
-        if (def.getDocumentBaseURI().equals(baseUrl)) {
-            return def;
-        }
-        List<Definition> defs = (List<Definition>)env.get(ToolConstants.IMPORTED_DEFINITION);
-        for (Definition arg : defs) {
-            if (arg.getDocumentBaseURI().equals(baseUrl)) {
-                return arg;
-            }
-        }
-        return null;
-    }
-
     private boolean isGlobaleBindings(Element binding) {
 
         boolean globleNode = binding.getNamespaceURI().equals(ToolConstants.NS_JAXWS_BINDINGS)
@@ -364,20 +310,6 @@
 
     }
 
-    private boolean isJAXWSParameter(Element binding) {
-        boolean parameterNode = ToolConstants.NS_JAXWS_BINDINGS.equals(binding.getNamespaceURI())
-                                && "parameter".equals(binding.getLocalName());
-        Node parentNode = binding.getParentNode();
-        if (parentNode instanceof Element) {
-            Element ele = (Element)parentNode;
-            if (parameterNode && ele.getAttributeNode("node") != null
-                && ele.getAttribute("node").indexOf("portType") > -1) {
-                return true;
-            }
-        }
-        return false;
-    }
-
     private Element[] getChildElements(Element parent, String nsUri) {
         List<Element> a = new ArrayList<Element>();
         NodeList children = parent.getChildNodes();
@@ -394,15 +326,27 @@
     }
 
     private void addBinding(String bindingFile) throws XMLStreamException {
-        String bindingLocation = ProcessorUtil.absolutize(ProcessorUtil.getFileOrURLName(bindingFile));
-
-        InputSource is = new InputSource(bindingLocation);
+        URI bindingURI = null;
+        try {
+            bindingURI = new URI(bindingFile);
+        } catch (URISyntaxException e2) {
+            //ignore
+        }
+        InputSource is = new InputSource(bindingFile);
         XMLStreamReader reader = StAXUtil.createFreshXMLStreamReader(is);
 
         StAXUtil.toStartTag(reader);
 
         if (isValidJaxwsBindingFile(bindingFile, reader)) {
-            Element root = parse(is);
+            InputStream inputStream;
+            Element root = null;
+            try {
+                inputStream = new FileInputStream(new File(bindingURI));
+                root = DOMUtils.readXml(inputStream).getDocumentElement();
+            } catch (Exception e1) {
+                Message msg = new Message("CAN_NOT_READ_AS_ELEMENT", LOG, new Object[] {bindingFile});
+                throw new ToolException(msg, e1); 
+            } 
             String wsdlLocation = root.getAttribute("wsdlLocation");
             URI wsdlURI = null;
             try {
@@ -414,22 +358,23 @@
 
             if (!wsdlURI.isAbsolute()) {
                 try {
-                    URI baseURI = new URI(bindingLocation);
+                    URI baseURI = new URI(bindingFile);
                     wsdlURI = baseURI.resolve(wsdlURI);
                 } catch (URISyntaxException e) {
-                    // ignore
+                    Message msg = new Message("NOT_URI", LOG, new Object[] {bindingFile});
+                    throw new ToolException(msg, e);
                 }
 
             }
 
-            if (getWSDlDefinition(wsdlURI.toString()) != null) {
-                jaxwsBindings.put(wsdlURI, root);
+            
+            if (wsdlURI.toString().equals(this.wsdlURL)) {
+                jaxwsBindings.add(root);
             } else {
                 String wsdl = (String)env.get(ToolConstants.CFG_WSDLURL);
-                Message msg = new Message("NOT_POINTTO_URL", LOG, new Object[] {bindingLocation, wsdl});
+                Message msg = new Message("NOT_POINTTO_URL", LOG, new Object[] {bindingFile, wsdl});
                 throw new ToolException(msg);
             }
-
         } else if (isValidJaxbBindingFile(reader)) {
             jaxbBindings.add(is);
         } else {
@@ -456,130 +401,54 @@
 
     }
 
-    private Element parse(InputSource source) {
-        try {
-            DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
-            builderFactory.setNamespaceAware(true);
-            builderFactory.setValidating(false);
-            DocumentBuilder builder = builderFactory.newDocumentBuilder();
-            builder.setErrorHandler(new ErrorHandler() {
-                public void error(SAXParseException e) throws SAXParseException {
-                    throw e;
-                }
-
-                public void fatalError(SAXParseException e) throws SAXParseException {
-                    throw e;
-                }
-
-                public void warning(SAXParseException err) throws SAXParseException {
-                    // do nothing
-                }
-            });
+    
+    
+    class ContextImpl implements NamespaceContext {
+        private Node targetNode;
 
-            // builder.setEntityResolver(new NullEntityResolver());
-            return builder.parse(source).getDocumentElement();
-        } catch (ParserConfigurationException e) {
-            throw new ToolException("parsing.parserConfigException", e);
-        } catch (FactoryConfigurationError e) {
-            throw new ToolException("parsing.factoryConfigException", e);
-        } catch (SAXException e) {
-            throw new ToolException("parsing.saxException", e);
-        } catch (IOException e) {
-            throw new ToolException("parsing.saxException", e);
+        public ContextImpl(Node node) {
+            targetNode = node;
         }
-    }
 
-    private Node evaluateBindingsNode(Node targetNode, String expression) throws WSDLException {
-        Node node = evaluateXPathNode(targetNode, expression, new javax.xml.namespace.NamespaceContext() {
-            public String getNamespaceURI(String prefix) {
-                return definition.getNamespace(prefix);
-            }
+        public String getNamespaceURI(String prefix) {
+            return targetNode.getOwnerDocument().lookupNamespaceURI(prefix);
+        }
 
-            public String getPrefix(String nsURI) {
-                throw new UnsupportedOperationException();
-            }
+        public String getPrefix(String nsURI) {
+            throw new UnsupportedOperationException();
+        }
 
-            public Iterator getPrefixes(String namespaceURI) {
-                throw new UnsupportedOperationException();
-            }
-        });
-        return node;
+        public Iterator getPrefixes(String namespaceURI) {
+            throw new UnsupportedOperationException();
+        }
     }
+    
 
-    private Node evaluateXPathNode(Node target, String expression, NamespaceContext namespaceContext) {
+    private Node queryXPathNode(Node target, String expression) {
         NodeList nlst;
         try {
-            xpath.setNamespaceContext(namespaceContext);
+            xpath.setNamespaceContext(new ContextImpl(target));
             nlst = (NodeList)xpath.evaluate(expression, target, XPathConstants.NODESET);
         } catch (XPathExpressionException e) {
-            e.printStackTrace();
-            return null; // abort processing this <jaxb:bindings>
-        }
-
-        if (nlst.getLength() == 0) {
-            // error("internalizer.XPathEvaluatesToNoTarget", new
-            // Object[]{expression});
-            return null; // abort
+            Message msg = new Message("XPATH_ERROR", LOG, new Object[] {expression});
+            throw new ToolException(msg, e);
         }
-
+       
         if (nlst.getLength() != 1) {
-            // error("internalizer.XPathEvaulatesToTooManyTargets", new
-            // Object[]{expression, nlst.getLength()});
-            return null; // abort
+            Message msg = new Message("ERROR_TARGETNODE_WITH_XPATH", LOG, new Object[] {expression});
+            throw new ToolException(msg);
         }
 
         Node rnode = nlst.item(0);
         if (!(rnode instanceof Element)) {
-            // error("internalizer.XPathEvaluatesToNonElement", new
-            // Object[]{expression});
-            return null; // abort
-        }
+            Message msg = new Message("ERROR_TARGETNODE_WITH_XPATH", LOG, new Object[] {expression});
+            throw new ToolException(msg);
+        } 
         return (Element)rnode;
     }
 
-    private void mergeJaxwsBinding(JAXWSBinding old, JAXWSBinding present) {
-        if (present.isEnableAsyncMapping()) {
-            old.setEnableAsyncMapping(present.isEnableAsyncMapping());
-        }
-        if (present.isEnableMime()) {
-            old.setEnableMime(present.isEnableMime());
-        }
-        if (present.isEnableWrapperStyle()) {
-            old.setEnableWrapperStyle(present.isEnableWrapperStyle());
-        }
-        if (present.getMethodName() != null) {
-            old.setMethodName(present.getMethodName());
-        }
-        if (present.getPackage() != null) {
-            old.setPackage(present.getPackage());
-        }
-        if (present.getJaxwsPara() != null) {
-            old.setJaxwsPara(present.getJaxwsPara());
-        }
-    }
-
-    private void addJAXWSBindingMap(Map<QName, JAXWSBinding> bindingMap, 
-                                    Node node, JAXWSBinding jaxwsBinding) {
-        if (bindingMap.containsKey(getQName(node))) {
-            JAXWSBinding binding = bindingMap.get(getQName(node));
-            mergeJaxwsBinding(binding, jaxwsBinding);
-        } else {
-            bindingMap.put(getQName(node), jaxwsBinding);
-        }
-    }
-
-    private String getTargetNamspace(Node node) {
-        Document doc = ((Element)node).getOwnerDocument();
-        if (!StringUtils.isEmpty(doc.getDocumentElement().getAttribute("targetNamespace"))) {
-            return doc.getDocumentElement().getAttribute("targetNamespace");
-        }
-        return node.getBaseURI();
-    }
-
-    private QName getQName(Node node) {
-        String ns = getTargetNamspace(node);
-        Element ele = (Element)node;
-        return new QName(ns, ele.getAttribute("name"));
+    public Node getWSDLNode() {
+        return this.wsdlNode;
     }
 
     private boolean isJAXWSBindings(Node bindings) {
@@ -597,32 +466,26 @@
 
     private NodeList getJaxbBindingNode(Element bindings) {
         NodeList nodeList = bindings.getElementsByTagNameNS(ToolConstants.NS_JAXB_BINDINGS, "bindings");
-        return nodeList.item(0).getChildNodes();       
-    }
-
-
-    public Map<String, JAXWSBinding> getDefinitionBindingMap() {
-        return this.definitionBindingMap;
-    }
-
-    public Map<QName, JAXWSBinding> getPortTypeBindingMap() {
-        return this.portTypeBindingMap;
-    }
-
-    public Map<QName, JAXWSBinding> getOperationBindingMap() {
-        return this.opertaionBindingMap;
-    }
-
-    public Map<QName, JAXWSBinding> getPartBindingMap() {
-        return this.partBindingMap;
+        return nodeList.item(0).getChildNodes();
     }
     
     public Element getCustomizedWSDLElement() {
-        if (this.customizedWSDLNode == null) {
-            customizedWSDLNode = this.wsdlNode;
-        }
-        return customizedWSDLNode;
-        
+        return this.wsdlNode;
     }
     
+   /* private URI getURI(String arg) {
+        String location = ProcessorUtil.absolutize(arg);
+        URI uri = null;
+        try {
+            uri = new URI(location);
+        } catch (URISyntaxException e) {
+            Message msg = new Message("NOT_URI", LOG, new Object[] {location});
+            throw new ToolException(msg, e);
+        }
+        return uri;
+    }*/
+    
+    public Set<InputSource> getJaxbBindings() {
+        return this.jaxbBindings;
+    }    
 }

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBinding.java?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBinding.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBinding.java Thu Jan  4 00:29:16 2007
@@ -30,22 +30,24 @@
 
     private boolean enableAsyncMapping;
 
-    private boolean enableMime;
+    private boolean enableMime = true;
 
     private Element element;
     private boolean required;
     private QName elementType;
 
-    private boolean enableWrapperStyle;
+    private boolean enableWrapperStyle = true;
 
     private String documentBaseURI;
 
     private String packageName;
-    
+
     private String methodName;
 
     private JAXWSParameter jaxwsPara;
     
+    private JAXWSClass jaxwsClass;
+
     public void setDocumentBaseURI(String baseURI) {
         this.documentBaseURI = baseURI;
     }
@@ -111,18 +113,27 @@
     }
 
     public void setJaxwsPara(JAXWSParameter para) {
-        this.jaxwsPara = para;
+        jaxwsPara = para;
     }
-    
+
     public JAXWSParameter getJaxwsPara() {
-        return this.jaxwsPara;
+        return jaxwsPara;
+    }
+    
+    public void setJaxwsClass(JAXWSClass clz) {
+        this.jaxwsClass = clz;
+    }
+
+    public JAXWSClass getJaxwsClass() {
+        return this.jaxwsClass;
     }
     
+
     public void setMethodName(String name) {
         methodName = name;
     }
+
     public String getMethodName() {
         return this.methodName;
     }
-    
 }

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBindingParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBindingParser.java?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBindingParser.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBindingParser.java Thu Jan  4 00:29:16 2007
@@ -19,17 +19,29 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.customiztion;
 
+import java.util.Iterator;
+import java.util.logging.Logger;
+
 import javax.wsdl.WSDLException;
 import javax.wsdl.extensions.ExtensionRegistry;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
 
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolException;
 
 public class JAXWSBindingParser {
-
+    private static final Logger LOG = LogUtils.getL7dLogger(CustomizationParser.class);
     private ExtensionRegistry extReg;
 
     public JAXWSBindingParser(ExtensionRegistry ext) {
@@ -60,13 +72,10 @@
             if (isPackageElement(element)) {
                 jaxwsBinding.setPackage(getPackageName(element));
             }
-            if (isJAXWSParameterElement(element)) {
-                JAXWSParameter jpara = new JAXWSParameter();
-                jpara.setName(element.getAttribute("name"));
-                jpara.setElementName(element.getAttribute("childElementName"));
-                jaxwsBinding.setJaxwsPara(jpara);
+            
+            if (isWrapperStyle(element)) {
+                jaxwsBinding.setEnableWrapperStyle(getNodeValue(element));
             }
-
         }
 
         if (children != null && children.getLength() > 0) {
@@ -79,6 +88,11 @@
                 if (isMIMEElement(child)) {
                     jaxwsBinding.setEnableMime(getNodeValue(child));
                 }
+                
+                if (isWrapperStyle(child)) {
+                    jaxwsBinding.setEnableWrapperStyle(getNodeValue(child));
+                }
+                
                 if (isPackageElement(child)) {
                     jaxwsBinding.setPackage(getPackageName(child));
                 }
@@ -86,7 +100,38 @@
                 if (isJAXWSMethodElement(child)) {
                     jaxwsBinding.setMethodName(getMethodName(child));
                 }
+                
+                if (isJAXWSParameterElement(child)) {
+                    Element childElement = (Element)child;
+                    String partPath = "//" +  childElement.getAttribute("part");
+                    Node node = queryXPathNode(element.getOwnerDocument().getDocumentElement(), partPath);
+                    String messageName = "";
+                    if (node != null) {
+                        Node messageNode = node.getParentNode();
+                        if (messageNode != null) {
+                            Element messageEle = (Element)messageNode;
+                            messageName =  messageEle.getAttribute("name");
+                        }
+                    }
+                    
+                    String name = childElement.getAttribute("name");
+                    String elementName = childElement.getAttribute("childElementName");
+                    JAXWSParameter jpara = new JAXWSParameter(messageName, elementName, name);
+                    jaxwsBinding.setJaxwsPara(jpara);
+                }
+                
+                if (isJAXWSClass(child)) {
+                    Element childElement = (Element)child;
+                    String clzName = childElement.getAttribute("name");
+                    String javadoc = "";
+                    Node docChild = DOMUtils.getChild(child, Element.ELEMENT_NODE);
+                    if (this.isJAXWSClassDoc(docChild)) {
+                        javadoc  = DOMUtils.getContent(docChild);
+                    }
 
+                    JAXWSClass jaxwsClass = new JAXWSClass(clzName, javadoc);
+                    jaxwsBinding.setJaxwsClass(jaxwsClass);                    
+                }
             }
         }
 
@@ -116,6 +161,17 @@
                && "parameter".equals(node.getLocalName());
 
     }
+    
+    private boolean isJAXWSClass(Node node) {
+        return (ToolConstants.NS_JAXWS_BINDINGS.equals(node.getNamespaceURI()))
+               && "class".equals(node.getLocalName());
+    }
+    
+    private boolean isJAXWSClassDoc(Node node) {
+        return (ToolConstants.NS_JAXWS_BINDINGS.equals(node.getNamespaceURI()))
+               && "javadoc".equals(node.getLocalName());
+    }
+    
 
     private String getPackageName(Node node) {
         Element ele = (Element)node;
@@ -127,6 +183,11 @@
                && ToolConstants.NS_JAXWS_BINDINGS.equals(node.getNamespaceURI());
 
     }
+    
+    private Boolean isWrapperStyle(Node node) {
+        return "enableWrapperStyle".equals(node.getLocalName())
+               && ToolConstants.NS_JAXWS_BINDINGS.equals(node.getNamespaceURI());
+    }
 
     private Boolean getNodeValue(Node node) {
         return Boolean.valueOf(node.getTextContent());
@@ -137,4 +198,47 @@
                && ToolConstants.NS_JAXWS_BINDINGS.equals(node.getNamespaceURI());
     }
 
+    private Node queryXPathNode(Node target, String expression) {
+        NodeList nlst;
+        try {
+            ContextImpl contextImpl = new ContextImpl(target);
+            XPath xpath = XPathFactory.newInstance().newXPath();
+            xpath.setNamespaceContext(contextImpl);
+            nlst = (NodeList)xpath.evaluate(expression, target, XPathConstants.NODESET);
+        } catch (XPathExpressionException e) {
+            Message msg = new Message("XPATH_ERROR", LOG, new Object[] {expression});
+            throw new ToolException(msg, e);
+        }
+
+        if (nlst.getLength() != 1) {
+            Message msg = new Message("ERROR_TARGETNODE_WITH_XPATH", LOG, new Object[] {expression});
+            throw new ToolException(msg);
+        }
+
+        Node rnode = nlst.item(0);
+        if (!(rnode instanceof Element)) {
+            return null;
+        }
+        return (Element)rnode;
+    }
+
+    class ContextImpl implements NamespaceContext {
+        private Node targetNode;
+
+        public ContextImpl(Node node) {
+            targetNode = node;
+        }
+
+        public String getNamespaceURI(String prefix) {
+            return targetNode.getOwnerDocument().lookupNamespaceURI(prefix);
+        }
+
+        public String getPrefix(String nsURI) {
+            throw new UnsupportedOperationException();
+        }
+
+        public Iterator getPrefixes(String namespaceURI) {
+            throw new UnsupportedOperationException();
+        }
+    }
 }

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSParameter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSParameter.java?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSParameter.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSParameter.java Thu Jan  4 00:29:16 2007
@@ -20,7 +20,14 @@
 
 public class JAXWSParameter {
     private String name;
-    private String elementName;
+    private String eleName;
+    private String messageName;
+    
+    public JAXWSParameter(String msgName , String elementName, String name) {
+        this.messageName = msgName;
+        this.eleName = elementName;
+        this.name = name;
+    }
 
     public void setName(String name) {
         this.name = name;
@@ -30,12 +37,22 @@
         return name;
     }
 
-    public void setElementName(String eleName) {
-        this.elementName = eleName;
+    public void setElementName(String elementName) {
+        this.eleName = elementName;
     }
 
     public String getElementName() {
-        return this.elementName;
+        return eleName;
+    }
+    
+    public String getMessageName() {
+        return this.messageName;
+    }
+    
+    public void setMessageName(String msgName) {
+        this.messageName = msgName;
     }
+    
+    
 
 }

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/Messages.properties?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/Messages.properties (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/Messages.properties Thu Jan  4 00:29:16 2007
@@ -25,5 +25,10 @@
 CAN_NOT_GET_WSDL_LOCATION = Can not get this wsdl
 JAXWSBINDINGS_WSDLLOC_ERROR = Attribute wsdlLocation value {0} in jaxws binding element is not an uri
 JAXWSBINDINGS_NOT_BIND = JAXWSBidnings do not bind to any wsdl.Check the wsdlLocation attribute in the JAXWSBindings element
+ERROR_TARGETNODE_WITH_XPATH = The xpath query identifies mutil or none target nodes with the query expression : {0}
+XPATH_ERROR = XPath query error , check the query expression : {0}
+NOT_URI = Can not construct new URI with this string : {0} 
+FILE_NOT_FOUND = Can not found the file : {0}
+CAN_NOT_READ_AS_ELEMENT = Can not read this file to a xml element : {0}
 
  

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java?view=diff&rev=492445&r1=492444&r2=492445
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java Thu Jan  4 00:29:16 2007
@@ -19,7 +19,13 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor;
 
+
+import java.util.Collection;
+import javax.xml.transform.TransformerException;
+
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.service.model.SchemaInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.model.JavaInterface;
@@ -35,9 +41,23 @@
 
     public void process() throws ToolException {
         super.process();
+        ServiceInfo serviceInfo = (ServiceInfo)context.get(ServiceInfo.class);
+
+        Collection<SchemaInfo> schemas = serviceInfo.getTypeInfo().getSchemas();
+        for (SchemaInfo schema : schemas) {
+            try {
+                System.out.println("----Schema -----");
+                DOMUtils.writeXml(schema.getElement(), System.out);
+                System.out.println("---------------");
+            } catch (TransformerException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+
+        //serviceInfo.getTypeInfo().getSchemas().size();
+        JavaModel jmodel = wsdlDefinitionToJavaModel(serviceInfo);
 
-        JavaModel jmodel = wsdlDefinitionToJavaModel(getServiceInfo());
-        
         if (jmodel == null) {
             Message msg = new Message("FAIL_TO_CREATE_JAVA_MODEL", LOG);
             throw new ToolException(msg);
@@ -48,6 +68,7 @@
         JavaModel javaModel = new JavaModel();
         context.put(JavaModel.class, javaModel);
 
+
         //javaModel.setJAXWSBinding(customizing(definition));
 
         // TODO refactroing the internal processors to use the service model
@@ -57,7 +78,8 @@
 
         ServiceProcessor serviceProcessor = new ServiceProcessor(context);
         serviceProcessor.process(serviceInfo);
-        
+
+
         //         SEIAnnotationProcessor seiAnnotationProcessor = new SEIAnnotationProcessor(context);
         //         seiAnnotationProcessor.process(serviceInfo);
 
@@ -67,30 +89,7 @@
             new BindingAnnotator().annotate(intf);
         }
 
+
         return javaModel;
     }
-
-    // TODO replace the definition with service model
-    //     private JAXWSBinding customizing(Definition def) {
-    //         JAXWSBinding binding = CustomizationParser.getInstance().getDefinitionExtension();
-    //         if (binding != null) {
-    //             return binding;
-    //         }
-    
-    //         List extElements = def.getExtensibilityElements();
-    //         if (extElements.size() > 0) {
-    //             Iterator iterator = extElements.iterator();
-    //             while (iterator.hasNext()) {
-    //                 Object obj = iterator.next();
-    //                 if (obj instanceof JAXWSBinding) {
-    //                     binding = (JAXWSBinding)obj;
-    //                 }
-    //             }
-    //         }
-    
-    //         if (binding == null) {
-    //             binding = new JAXWSBinding();
-    //         }
-    //         return binding;
-    //     }
 }



Mime
View raw message