cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r588283 [17/18] - in /incubator/cxf/branches/jliu: ./ api/ api/src/main/java/org/apache/cxf/databinding/ api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/phase/ api/src/main/jav...
Date Thu, 25 Oct 2007 17:10:56 GMT
Modified: incubator/cxf/branches/jliu/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java Thu Oct 25 10:09:20 2007
@@ -163,9 +163,12 @@
         Map<String, String> nsPkgMap = context.getNamespacePackageMap();
         for (String ns : nsPkgMap.keySet()) {
             File file = JAXBUtils.getPackageMappingSchemaBindingFile(ns, context.mapPackageName(ns));
-            InputSource ins = new InputSource(file.toURI().toString());
-            schemaCompiler.parseSchema(ins);
-            FileUtils.delete(file);
+            try {
+                InputSource ins = new InputSource(file.toURI().toString());
+                schemaCompiler.parseSchema(ins);
+            } finally {
+                FileUtils.delete(file);                
+            }
         }
         
         if (context.getPackageName() != null) {
@@ -297,6 +300,12 @@
 
             if (rawJaxbModelGenCode instanceof S2JJAXBModel) {
                 S2JJAXBModel schem2JavaJaxbModel = (S2JJAXBModel)rawJaxbModelGenCode;
+
+                ClassCollector classCollector = context.get(ClassCollector.class);
+                for (JClass cls : schem2JavaJaxbModel.getAllObjectFactories()) {
+                    classCollector.getTypesPackages().add(cls._package().name());
+                }
+
                 JCodeModel jcodeModel = schem2JavaJaxbModel.generateCode(null, null);
 
                 if (!isSuppressCodeGen()) {
@@ -304,6 +313,7 @@
                 }
 
                 context.put(JCodeModel.class, jcodeModel);
+
                 for (String str : fileCodeWriter.getExcludeFileList()) {
                     context.getExcludeFileList().add(str);
                 }

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomNodeSelector.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomNodeSelector.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomNodeSelector.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomNodeSelector.java Thu Oct 25 10:09:20 2007
@@ -24,6 +24,7 @@
 
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 import org.apache.cxf.helpers.MapNamespaceContext;
 import org.apache.cxf.helpers.XPathUtils;
@@ -68,9 +69,18 @@
 
     public Node queryNode(final Node target, final String expression) {
         XPathUtils xpath = new XPathUtils(context);
-
+       
         Node node = (Node) xpath.getValue(expression, target, XPathConstants.NODE);
 
         return node;
     }
+    
+    public NodeList queryNodes(final Node target, final String expression) {
+        XPathUtils xpath = new XPathUtils(context);
+       
+        NodeList nodeList = (NodeList) xpath.getValue(expression, target, XPathConstants.NODESET);
+
+        return nodeList;
+    }
+    
 }

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java Thu Oct 25 10:09:20 2007
@@ -18,11 +18,15 @@
  */
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.customization;
 
+import java.io.File;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.logging.Logger;
@@ -37,11 +41,15 @@
 
 import org.xml.sax.InputSource;
 
+import org.apache.cxf.Bus;
+import org.apache.cxf.catalog.OASISCatalogManager;
 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.helpers.DOMUtils;
+import org.apache.cxf.helpers.FileUtils;
 import org.apache.cxf.helpers.MapNamespaceContext;
+import org.apache.cxf.helpers.XMLUtils;
 import org.apache.cxf.resource.URIResolver;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
@@ -49,14 +57,17 @@
 import org.apache.cxf.tools.util.StAXUtil;
 import org.apache.cxf.tools.util.URIParserUtil;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ProcessorUtil;
+import org.apache.xml.resolver.Catalog;
 
 public final class CustomizationParser {
     // For WSDL1.1
     private static final Logger LOG = LogUtils.getL7dLogger(CustomizationParser.class);
 
     private ToolContext env;
-    private final List<Element> jaxwsBindings = new ArrayList<Element>();
+    // map for jaxws binding and wsdl element
+    private final Map<Element, Element> jaxwsBindingsMap = new HashMap<Element, Element>();
     private final List<InputSource> jaxbBindings = new ArrayList<InputSource>();
+    private final Map<String, Element> customizedElements = new HashMap<String, Element>();
 
     private Element handlerChains;
     private Element wsdlNode;
@@ -65,7 +76,7 @@
     private CustomNodeSelector nodeSelector = new CustomNodeSelector();
 
     public CustomizationParser() {
-        jaxwsBindings.clear();
+        jaxwsBindingsMap.clear();
         jaxbBindings.clear();
     }
 
@@ -77,8 +88,15 @@
         this.env = pe;
         String[] bindingFiles;
         try {
-            this.wsdlURL = URIParserUtil.getAbsoluteURI((String)env.get(ToolConstants.CFG_WSDLURL));
-            this.wsdlNode = this.getTargetNode(this.wsdlURL);
+            wsdlURL = URIParserUtil.getAbsoluteURI((String)env.get(ToolConstants.CFG_WSDLURL));
+
+            wsdlNode = getTargetNode(this.wsdlURL);
+
+            if (wsdlNode == null && env.get(ToolConstants.CFG_CATALOG) != null) {
+                wsdlNode = resolveNodeByCatalog(wsdlURL);
+            }
+            // TODO: if wsdlNode is null throw exception
+            customizedElements.put(wsdlURL.toString(), wsdlNode);
             bindingFiles = (String[])env.get(ToolConstants.CFG_BINDING);
             if (bindingFiles == null) {
                 return;
@@ -97,27 +115,35 @@
             }
         }
 
-        for (Element element : jaxwsBindings) {
+        for (Element element : jaxwsBindingsMap.keySet()) {
             nodeSelector.addNamespaces(element);
-            internalizeBinding(element, "");
+            Element targetNode = jaxwsBindingsMap.get(element);
+            internalizeBinding(element, targetNode, "");
+            String uri = element.getAttribute("wsdlLocation");
+            customizedElements.put(uri, targetNode);
         }
         buildHandlerChains();
     }
 
-    public Element getTargetNode(String wsdlLoc) {
+    public Element getTargetNode(String uri) {
         Document doc = null;
         InputStream ins = null;
+
         try {
-            URIResolver resolver = new URIResolver(wsdlLoc);
+            URIResolver resolver = new URIResolver(uri);
             ins = resolver.getInputStream();
         } catch (IOException e1) {
-            throw new ToolException(e1);
+            return null;
         }
 
+        if (ins == null) {
+            return null;
+        }
+        
         try {
             doc = DOMUtils.readXml(ins);
         } catch (Exception e) {
-            Message msg = new Message("CAN_NOT_READ_AS_ELEMENT", LOG, new Object[] {wsdlLoc});
+            Message msg = new Message("CAN_NOT_READ_AS_ELEMENT", LOG, new Object[] {uri});
             throw new ToolException(msg, e);
         }
 
@@ -129,7 +155,7 @@
 
     private void buildHandlerChains() {
 
-        for (Element jaxwsBinding : jaxwsBindings) {
+        for (Element jaxwsBinding : jaxwsBindingsMap.keySet()) {
             NodeList nl = jaxwsBinding.getElementsByTagNameNS(ToolConstants.HANDLER_CHAINS_URI,
                                                               ToolConstants.HANDLER_CHAINS);
             if (nl.getLength() == 0) {
@@ -148,8 +174,7 @@
         Node annotationNode = nodeSelector.queryNode(node, "//xsd:annotation");
 
         if (annotationNode == null) {
-            annotationNode = node.getOwnerDocument().createElementNS(ToolConstants.SCHEMA_URI,
-                                                                     "annotation");
+            annotationNode = node.getOwnerDocument().createElementNS(ToolConstants.SCHEMA_URI, "annotation");
         }
 
         nodes[0] = annotationNode;
@@ -157,8 +182,7 @@
         Node appinfoNode = nodeSelector.queryNode(annotationNode, "//xsd:appinfo");
 
         if (appinfoNode == null) {
-            appinfoNode = node.getOwnerDocument().createElementNS(ToolConstants.SCHEMA_URI,
-                                                                  "appinfo");
+            appinfoNode = node.getOwnerDocument().createElementNS(ToolConstants.SCHEMA_URI, "appinfo");
             annotationNode.appendChild(appinfoNode);
         }
         nodes[1] = appinfoNode;
@@ -177,13 +201,15 @@
         Element jaxbBindingElement = getJaxbBindingElement(jaxwsBindingNode);
         appendJaxbVersion((Element)schemaNode);
         if (jaxbBindingElement != null) {
-            copyAllJaxbDeclarations(nodeSelector.queryNode(schemaNode,
-                                                           jaxbBindingElement.getAttribute("node")),
-                                    jaxbBindingElement);
+            NodeList nlist = nodeSelector.queryNodes(schemaNode, jaxbBindingElement.getAttribute("node"));
+            for (int i = 0; i < nlist.getLength(); i++) {
+                Node node = nlist.item(i);
+                copyAllJaxbDeclarations(node, jaxbBindingElement);
+            }
             return;
         }
 
-        Node[] embededNodes  = getAnnotationNodes(schemaNode);
+        Node[] embededNodes = getAnnotationNodes(schemaNode);
         Node annotationNode = embededNodes[0];
         Node appinfoNode = embededNodes[1];
 
@@ -207,13 +233,13 @@
         }
     }
 
-    protected void internalizeBinding(Element bindings, String expression) {
+    protected void internalizeBinding(Element bindings, Element targetNode, String expression) {
         if (bindings.getAttributeNode("wsdlLocation") != null) {
             expression = "/";
         }
 
         if (isGlobaleBindings(bindings)) {
-            String pfx = wsdlNode.getPrefix();
+            String pfx = targetNode.getPrefix();
             if (pfx == null) {
                 pfx = "";
             } else {
@@ -221,7 +247,7 @@
             }
 
             nodeSelector.addNamespaces(wsdlNode);
-            Node node = nodeSelector.queryNode(wsdlNode, "//" + pfx + "definitions");
+            Node node = nodeSelector.queryNode(targetNode, "//" + pfx + "definitions");
             copyBindingsToWsdl(node, bindings, nodeSelector.getNamespaceContext());
         }
 
@@ -230,25 +256,28 @@
 
             nodeSelector.addNamespaces(bindings);
 
-            Node node = nodeSelector.queryNode(wsdlNode, expression);
-            if (node == null) {
-                throw new ToolException(new Message("NODE_NOT_EXISTS",
-                                                    LOG, new Object[] {expression}));
+            NodeList nodeList = nodeSelector.queryNodes(targetNode, expression);
+            if (nodeList == null || nodeList.getLength() == 0) {
+                throw new ToolException(new Message("NODE_NOT_EXISTS", LOG, new Object[] {expression}));
             }
 
-            if (hasJaxbBindingDeclaration(bindings)) {
-                copyAllJaxbDeclarations(node, bindings);
-            } else {
-                copyBindingsToWsdl(node, bindings, nodeSelector.getNamespaceContext());
+            for (int i = 0; i < nodeList.getLength(); i++) {
+                Node node = nodeList.item(i);
+                if (hasJaxbBindingDeclaration(bindings)) {
+                    copyAllJaxbDeclarations(node, bindings);
+                } else {
+                    copyBindingsToWsdl(node, bindings, nodeSelector.getNamespaceContext());
+                }
             }
         }
 
         Element[] children = getChildElements(bindings, ToolConstants.NS_JAXWS_BINDINGS);
         for (int i = 0; i < children.length; i++) {
             if (children[i].getNodeType() == Node.ELEMENT_NODE) {
-                internalizeBinding(children[i], expression);
+                internalizeBinding(children[i], targetNode, expression);
             }
         }
+
     }
 
     private void copyBindingsToWsdl(Node node, Node bindings, MapNamespaceContext ctx) {
@@ -258,8 +287,8 @@
 
         for (Map.Entry<String, String> ent : ctx.getUsedNamespaces().entrySet()) {
             if (node.lookupNamespaceURI(ent.getKey()) == null) {
-                node.getOwnerDocument().getDocumentElement()
-                    .setAttribute("xmlns:" + ent.getKey(), ent.getValue());
+                node.getOwnerDocument().getDocumentElement().setAttribute("xmlns:" + ent.getKey(),
+                                                                          ent.getValue());
             }
 
         }
@@ -298,7 +327,6 @@
                 if (attrNode != null) {
                     cloneNode.removeChild(child);
                 }
-
             }
         }
         firstChild.appendChild(cloneNode);
@@ -345,58 +373,142 @@
 
         StAXUtil.toStartTag(reader);
 
+        Element root = null;
+        try {
+            URIResolver resolver = new URIResolver(bindingFile);
+            root = DOMUtils.readXml(resolver.getInputStream()).getDocumentElement();
+        } catch (Exception e1) {
+            Message msg = new Message("CAN_NOT_READ_AS_ELEMENT", LOG, new Object[] {bindingFile});
+            throw new ToolException(msg, e1);
+        }
         if (isValidJaxwsBindingFile(bindingFile, reader)) {
-            Element root = null;
-            try {
-                URIResolver resolver = new URIResolver(bindingFile);
-                root = DOMUtils.readXml(resolver.getInputStream()).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 {
-                wsdlURI = new URI(wsdlLocation);
-            } catch (URISyntaxException e) {
-                Message msg = new Message("JAXWSBINDINGS_WSDLLOC_ERROR", LOG, new Object[] {wsdlLocation});
-                throw new ToolException(msg);
-            }
 
-            if (!wsdlURI.isAbsolute()) {
-                try {
-                    URI baseURI = new URI(bindingFile);
-                    wsdlURI = baseURI.resolve(wsdlURI);
-                } catch (URISyntaxException e) {
-                    Message msg = new Message("NOT_URI", LOG, new Object[] {bindingFile});
-                    throw new ToolException(msg, e);
+            String wsdlLocation = root.getAttribute("wsdlLocation");
+            Element targetNode = null;
+            if (!StringUtils.isEmpty(wsdlLocation)) {
+                String wsdlURI = getAbsoluteURI(wsdlLocation, bindingFile);
+                targetNode = getTargetNode(wsdlURI);
+                String resolvedLoc = wsdlURI;
+                if (targetNode == null && env.get(ToolConstants.CFG_CATALOG) != null) {
+                    resolvedLoc = resolveByCatalog(wsdlURI.toString());
+                    targetNode = getTargetNode(resolvedLoc);
+                }
+                if (targetNode == null) {
+                    Message msg = new Message("POINT_TO_WSDL_DOES_NOT_EXIST", 
+                                              LOG, new Object[] {bindingFile, resolvedLoc});
+                    throw new ToolException(msg);
                 }
 
-            }
+                root.setAttribute("wsdlLocation", wsdlURI);
+            } else {
+                targetNode = wsdlNode;
 
-            URI normalizedURL = null;
-            if (this.wsdlURL != null) {
-                normalizedURL = URI.create(this.wsdlURL).normalize();
+                root.setAttribute("wsdlLocation", wsdlURL);
             }
+            jaxwsBindingsMap.put(root, targetNode);
 
-            if (wsdlURI.normalize().equals(normalizedURL)) {
-                jaxwsBindings.add(root);
+        } else if (isValidJaxbBindingFile(reader)) {
+            String schemaLocation = root.getAttribute("schemaLocation");
+            if (StringUtils.isEmpty(schemaLocation)) {
+                InputSource tmpIns = null;
+                try {
+                    tmpIns = convertToTmpInputSource(root, wsdlURL);
+                } catch (Exception e1) {
+                    Message msg = new Message("FAILED_TO_ADD_SCHEMALOCATION", LOG, bindingFile);
+                    throw new ToolException(msg, e1);
+                }
+                jaxbBindings.add(tmpIns);
             } else {
-                Message msg = new Message("NOT_POINTTO_URL", LOG, new Object[] {bindingFile, 
-                                                                                wsdlURI.normalize(), 
-                                                                                normalizedURL});
-                throw new ToolException(msg);
+                String schemeURI = this.getAbsoluteURI(schemaLocation, bindingFile);
+                Element ele = getTargetNode(schemeURI);
+                if (ele != null) {
+                    jaxbBindings.add(is);
+                } else {
+                    // try to resolve it with CatalogReslover
+                    String resolvedLocation = null;
+                    if (env.get(ToolConstants.CFG_CATALOG) != null) {
+                        resolvedLocation = resolveByCatalog(schemaLocation);
+                    }
+                    if (resolvedLocation == null) {
+                        Message msg = new Message("POINT_TO_XSD_DOES_NOT_EXIST", LOG, schemaLocation);
+                        throw new ToolException(msg);
+                    } else {
+                        InputSource tmpIns = null;
+                        try {
+                            tmpIns = convertToTmpInputSource(root, resolvedLocation);
+                        } catch (Exception e1) {
+                            Message msg = new Message("FAILED_TO_ADD_SCHEMALOCATION", LOG, bindingFile);
+                            throw new ToolException(msg, e1);
+                        }
+                        jaxbBindings.add(tmpIns);
+                    }
+                }
             }
-        } else if (isValidJaxbBindingFile(reader)) {
-            jaxbBindings.add(is);
+
         } else {
             Message msg = new Message("UNKNOWN_BINDING_FILE", LOG, bindingFile);
             throw new ToolException(msg);
         }
     }
 
+    private String getAbsoluteURI(String  uri, String bindingFile) {
+        URI locURI = null;
+        try {
+            locURI = new URI(uri);
+        } catch (URISyntaxException e) {
+            Message msg = new Message("BINDING_LOC_ERROR", 
+                                      LOG, new Object[] {uri});
+            throw new ToolException(msg);
+        }
+
+        if (!locURI.isAbsolute()) {
+            try {
+                String base = URIParserUtil.getAbsoluteURI(bindingFile);
+                URI baseURI = new URI(base);
+                locURI = baseURI.resolve(locURI);
+            } catch (URISyntaxException e) {
+                Message msg = new Message("NOT_URI", LOG, new Object[] {bindingFile});
+                throw new ToolException(msg, e);
+            }
+
+        }
+        return locURI.toString();
+    }
+    
+    private Element resolveNodeByCatalog(String url) {
+        String resolvedLocation = resolveByCatalog(url);
+        return getTargetNode(resolvedLocation);
+    }
+
+    private String resolveByCatalog(String url) {
+        Bus bus = (Bus)env.get(Bus.class);
+        Catalog catalogResolver = OASISCatalogManager.getCatalogManager(bus).getCatalog();
+        String resolvedLocation;
+        try {
+            resolvedLocation = catalogResolver.resolveSystem(url);
+            if (resolvedLocation == null) {
+                resolvedLocation = catalogResolver.resolveURI(url);
+            }
+        } catch (Exception e1) {
+            Message msg = new Message("FAILED_RESOLVE_CATALOG", LOG, url);
+            throw new ToolException(msg, e1);
+        }
+        return resolvedLocation;
+    }
+
+    private InputSource convertToTmpInputSource(Element ele, String schemaLoc) throws Exception {
+        InputSource result = null;
+        ele.setAttribute("schemaLocation", schemaLoc);
+        File tmpFile = FileUtils.createTempFile("jaxbbinding", ".xml");
+        XMLUtils.writeTo(ele, new FileOutputStream(tmpFile));
+        result = new InputSource(URIParserUtil.getAbsoluteURI(tmpFile.getAbsolutePath()));
+        tmpFile.deleteOnExit();
+        return result;
+    }
+
     private boolean isValidJaxbBindingFile(XMLStreamReader reader) {
         if (ToolConstants.JAXB_BINDINGS.equals(reader.getName())) {
+
             return true;
         }
         return false;
@@ -404,10 +516,14 @@
 
     private boolean isValidJaxwsBindingFile(String bindingLocation, XMLStreamReader reader) {
         if (ToolConstants.JAXWS_BINDINGS.equals(reader.getName())) {
-            String wsdlLocation = reader.getAttributeValue(null, "wsdlLocation");
-            if (!StringUtils.isEmpty(wsdlLocation)) {
-                return true;
-            }
+            // Comment this check , by default wsdlLocation value will be the
+            // user input wsdl url
+            /*
+             * String wsdlLocation = reader.getAttributeValue(null,
+             * "wsdlLocation"); if (!StringUtils.isEmpty(wsdlLocation)) { return
+             * true; }
+             */
+            return true;
         }
         return false;
 
@@ -416,6 +532,7 @@
     protected void setWSDLNode(final Element node) {
         this.wsdlNode = node;
     }
+
     public Node getWSDLNode() {
         return this.wsdlNode;
     }
@@ -436,7 +553,7 @@
     protected Element getJaxbBindingElement(final Element bindings) {
         NodeList list = bindings.getElementsByTagNameNS(ToolConstants.NS_JAXB_BINDINGS, "bindings");
         if (list.getLength() > 0) {
-            return (Element) list.item(0);
+            return (Element)list.item(0);
         }
         return null;
     }
@@ -452,8 +569,8 @@
         return false;
     }
 
-    public Element getCustomizedWSDLElement() {
-        return this.wsdlNode;
+    public Map<String, Element> getCustomizedWSDLElements() {
+        return this.customizedElements;
     }
 
     public List<InputSource> getJaxbBindings() {

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties Thu Oct 25 10:09:20 2007
@@ -19,11 +19,15 @@
 #
 #
 STAX_PARSER_ERROR = StAX parser error, check your external binding file(s)
-UNKNOWN_BINDING_FILE= Unknown external binding files : {0}
-NOT_POINTTO_URL = External binding file: {0} does not point to the specified wsdl: {2}, resolved as {1}
-JAXWSBINDINGS_WSDLLOC_ERROR = Attribute wsdlLocation value {0} in jaxws binding element is not an URI
+UNKNOWN_BINDING_FILE= Unknown external binding files: {0}
+CAN_NOT_FIND_BINDING_WSDL = Can not read the specified wsdl {0} that external binding file {1} points to
+BINDING_LOC_ERROR = Attribute wsdlLocation/schemaLocation value {0} in jaxws binding element is not an URI
 ERROR_TARGETNODE_WITH_XPATH = XPath query {0} is identifying either multiple or no target nodes.
-XPATH_ERROR = XPath query error , check the query expression : {0}
-NOT_URI = Can not construct new URI with this string : {0}
-CAN_NOT_READ_AS_ELEMENT = Can not read this file to a xml element : {0}
-NODE_NOT_EXISTS = Can not find any node with the XPath {0}
\ No newline at end of file
+XPATH_ERROR = XPath query error, check the query expression: {0}
+NOT_URI = Can not construct new URI with this string: {0}
+CAN_NOT_READ_AS_ELEMENT = The binding file: {0} references a not well-formed xml document 
+NODE_NOT_EXISTS = Could not find any node with the XPath expression: {0}
+FAILED_TO_ADD_SCHEMALOCATION = Failed to inject schemaLocation for binding file {0}
+POINT_TO_WSDL_DOES_NOT_EXIST  = Binding file: {0} points to a nonexistent wsdl(resolved as {1})
+POINT_TO_XSD_DOES_NOT_EXIST  = Binding file: {0} points to a nonexistent xsd(resolved as {1})
+FAILED_RESOLVE_CATALOG = Failed to resolve catalog {0} 

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java Thu Oct 25 10:09:20 2007
@@ -22,6 +22,8 @@
 import java.io.IOException;
 import java.io.Writer;
 
+import javax.jws.HandlerChain;
+
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 
@@ -29,7 +31,8 @@
 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.model.JavaAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ProcessorUtil;
 
@@ -37,13 +40,13 @@
 
     private static final String HANDLER_CHAIN_NAME = "";
     private JavaInterface intf;
-    private JavaAnnotation handlerChainAnnotation;
+    private JAnnotation handlerChainAnnotation;
 
     public HandlerConfigGenerator() {
         this.name = ToolConstants.HANDLER_GENERATOR;
     }
 
-    public JavaAnnotation getHandlerAnnotation() {
+    public JAnnotation getHandlerAnnotation() {
         return handlerChainAnnotation;
     }
 
@@ -73,9 +76,10 @@
                                                ToolConstants.HANDLER_CHAIN);
         if (nl.getLength() > 0) {
             String fName = ProcessorUtil.getHandlerConfigFileName(this.intf.getName());
-            handlerChainAnnotation = new JavaAnnotation("HandlerChain");
-            handlerChainAnnotation.addArgument("name", HANDLER_CHAIN_NAME);
-            handlerChainAnnotation.addArgument("file", fName + ".xml");
+            handlerChainAnnotation = new JAnnotation(HandlerChain.class);
+            handlerChainAnnotation.addElement(new JAnnotationElement("name", 
+                                                                     HANDLER_CHAIN_NAME));
+            handlerChainAnnotation.addElement(new JAnnotationElement("file", fName + ".xml"));           
             generateHandlerChainFile(e, parseOutputName(this.intf.getPackageName(),
                                                         fName,
                                                         ".xml"));

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java Thu Oct 25 10:09:20 2007
@@ -26,6 +26,7 @@
 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.model.JAnnotation;
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaModel;
 import org.apache.cxf.tools.util.ClassCollector;
@@ -87,7 +88,7 @@
                 handlerGen.setJavaInterface(intf);
                 handlerGen.generate(getEnvironment());
 
-                String annot = handlerGen.getHandlerAnnotation().toString();
+                JAnnotation annot = handlerGen.getHandlerAnnotation();
                 if (handlerGen.getHandlerAnnotation() != null
                     && !intf.getAnnotations().contains(annot)) {
                     intf.addAnnotation(annot);

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java Thu Oct 25 10:09:20 2007
@@ -26,12 +26,13 @@
 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.model.JAnnotation;
 import org.apache.cxf.tools.common.model.JavaModel;
+import org.apache.cxf.tools.common.model.JavaPort;
 import org.apache.cxf.tools.common.model.JavaServiceClass;
 import org.apache.cxf.tools.util.ClassCollector;
 
 public class ServiceGenerator extends AbstractJAXWSGenerator {
-    //private static final Logger LOG = LogUtils.getL7dLogger(AbstractGenerator.class);
     private static final String SERVICE_TEMPLATE = TEMPLATE_BASE + "/service.vm";
 
     public ServiceGenerator() {
@@ -81,15 +82,19 @@
                 handlerGen.setJavaInterface(js);
                 handlerGen.generate(getEnvironment());
 
-                String annot = handlerGen.getHandlerAnnotation().toString();
+                JAnnotation annot = handlerGen.getHandlerAnnotation();
                 if (handlerGen.getHandlerAnnotation() != null
                     && !js.getAnnotations().contains(annot)) {
                     js.addAnnotation(annot);
-                    js.addImport("javax.jws.HandlerChain");
                 }
             }
 
-            
+            for (JavaPort port : js.getPorts()) {
+                if (!port.getPackageName().equals(js.getPackageName())) {
+                    js.addImport(port.getFullClassName());
+                }
+            }
+
             String url = (String)env.get(ToolConstants.CFG_WSDLURL);
             String location = (String)env.get(ToolConstants.CFG_WSDLLOCATION);
             if (location == null 

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java Thu Oct 25 10:09:20 2007
@@ -24,7 +24,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.common.i18n.Message;
@@ -34,11 +33,13 @@
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaModel;
+import org.apache.cxf.tools.util.ClassCollector;
 import org.apache.cxf.tools.wsdlto.core.WSDLToProcessor;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.PortTypeProcessor;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.BindingAnnotator;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.WebServiceAnnotator;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.XmlSeeAlsoAnnotator;
 
 public class WSDLToJavaProcessor extends WSDLToProcessor implements ClassNameProcessor {
     private static final String MODEL_MAP = WSDLToProcessor.class.getName() 
@@ -92,6 +93,7 @@
         for (JavaInterface intf : javaModel.getInterfaces().values()) {
             if (!interfaces.contains(intf)) {
                 intf.annotate(new WebServiceAnnotator());
+                intf.annotate(new XmlSeeAlsoAnnotator(context.get(ClassCollector.class)));
                 if (serviceInfo.getBindings().size() > 0) {
                     intf.annotate(new BindingAnnotator());
                 }

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java Thu Oct 25 10:09:20 2007
@@ -24,6 +24,8 @@
 import java.util.List;
 import java.util.logging.Level;
 
+import javax.jws.WebParam;
+
 import org.apache.cxf.service.model.FaultInfo;
 import org.apache.cxf.service.model.MessageInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
@@ -31,13 +33,16 @@
 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.model.JavaAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.JavaParameter;
 import org.apache.cxf.tools.common.model.JavaReturn;
+import org.apache.cxf.tools.common.model.JavaType;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBinding;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.SoapBindingAnnotator;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.WSActionAnnotator;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.WebMethodAnnotator;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.WebResultAnnotator;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.WrapperAnnotator;
@@ -58,12 +63,15 @@
         Collection<FaultInfo> faults = operation.getFaults();
         FaultProcessor faultProcessor = new FaultProcessor(context);
         faultProcessor.process(method, faults);
+
+        method.annotate(new WSActionAnnotator(operation));
+
         intf.addMethod(method);
     }
 
     void processMethod(JavaMethod method, OperationInfo operation,
                               JAXWSBinding globalBinding) throws ToolException {
-        if (isAsynCMethod(method)) {
+        if (isAsyncMethod(method)) {
             return;
         }
         MessageInfo inputMessage = operation.getInput();
@@ -92,7 +100,7 @@
         }
 
         method.annotate(new WebResultAnnotator());
-        method.annotate(new SoapBindingAnnotator());
+        method.annotate(new SoapBindingAnnotator());                
 
         JAXWSBinding opBinding = (JAXWSBinding)operation.getExtensor(JAXWSBinding.class);
 
@@ -146,7 +154,7 @@
         }
     }
 
-    private boolean isAsynCMethod(JavaMethod method) {
+    private boolean isAsyncMethod(JavaMethod method) {
         if (method.getName().toLowerCase()
             .equals((method.getOperationName() + ToolConstants.ASYNC_METHOD_SUFFIX).toLowerCase())) {
             return true;
@@ -162,64 +170,70 @@
         method.getInterface().addImport("javax.xml.ws.Response");
     }
 
-    private void addPollingMethod(JavaMethod method) throws ToolException {
-        JavaMethod pollingMethod = new JavaMethod(method.getInterface());
-        pollingMethod.setName(method.getName() + ToolConstants.ASYNC_METHOD_SUFFIX);
-        pollingMethod.setStyle(method.getStyle());
-        pollingMethod.setWrapperStyle(method.isWrapperStyle());
-        pollingMethod.setSoapAction(method.getSoapAction());
-        pollingMethod.setOperationName(method.getOperationName());
+    private void addCallbackMethod(JavaMethod method) throws ToolException {
+        JavaMethod callbackMethod = new JavaMethod(method.getInterface());
+        callbackMethod.setAsync(true);
+        callbackMethod.setName(method.getName() + ToolConstants.ASYNC_METHOD_SUFFIX);
+        callbackMethod.setStyle(method.getStyle());
+        callbackMethod.setWrapperStyle(method.isWrapperStyle());
+        callbackMethod.setSoapAction(method.getSoapAction());
+        callbackMethod.setOperationName(method.getOperationName());
 
         JavaReturn future = new JavaReturn();
         future.setClassName("Future<?>");
-        pollingMethod.setReturn(future);
+        callbackMethod.setReturn(future);
 
         // REVISIT: test the operation name in the annotation
-        pollingMethod.annotate(new WebMethodAnnotator());
-        pollingMethod.addAnnotation("ResponseWrapper", method.getAnnotationMap().get("ResponseWrapper"));
-        pollingMethod.addAnnotation("RequestWrapper", method.getAnnotationMap().get("RequestWrapper"));
-        pollingMethod.addAnnotation("SOAPBinding", method.getAnnotationMap().get("SOAPBinding"));
+        callbackMethod.annotate(new WebMethodAnnotator());
+        callbackMethod.addAnnotation("ResponseWrapper", method.getAnnotationMap().get("ResponseWrapper"));
+        callbackMethod.addAnnotation("RequestWrapper", method.getAnnotationMap().get("RequestWrapper"));
+        callbackMethod.addAnnotation("SOAPBinding", method.getAnnotationMap().get("SOAPBinding"));
 
         for (Iterator iter = method.getParameters().iterator(); iter.hasNext();) {
-            pollingMethod.addParameter((JavaParameter)iter.next());
+            callbackMethod.addParameter((JavaParameter)iter.next());
         }
 
         JavaParameter asyncHandler = new JavaParameter();
+        
         asyncHandler.setName("asyncHandler");
+        asyncHandler.setCallback(true);
         asyncHandler.setClassName(getAsyncClassName(method, "AsyncHandler"));
-        JavaAnnotation asyncHandlerAnnotation = new JavaAnnotation("WebParam");
-        asyncHandlerAnnotation.addArgument("name", "asyncHandler");
-        asyncHandlerAnnotation.addArgument("targetNamespace", "");
-        asyncHandler.setAnnotation(asyncHandlerAnnotation);
-
-        pollingMethod.addParameter(asyncHandler);
+        asyncHandler.setStyle(JavaType.Style.IN);
+        
+        callbackMethod.addParameter(asyncHandler);
+        
+        JAnnotation asyncHandlerAnnotation = new JAnnotation(WebParam.class);
+        asyncHandlerAnnotation.addElement(new JAnnotationElement("name", "asyncHandler"));
+        asyncHandlerAnnotation.addElement(new JAnnotationElement("targetNamespace", ""));
+        asyncHandler.setAnnotation(asyncHandlerAnnotation);                
 
-        method.getInterface().addMethod(pollingMethod);
+        method.getInterface().addMethod(callbackMethod);
     }
 
-    private void addCallbackMethod(JavaMethod method) throws ToolException {
-        JavaMethod callbackMethod = new JavaMethod(method.getInterface());
-        callbackMethod.setName(method.getName() + ToolConstants.ASYNC_METHOD_SUFFIX);
-        callbackMethod.setStyle(method.getStyle());
-        callbackMethod.setWrapperStyle(method.isWrapperStyle());
-        callbackMethod.setSoapAction(method.getSoapAction());
-        callbackMethod.setOperationName(method.getOperationName());
+    private void addPollingMethod(JavaMethod method) throws ToolException {
+        JavaMethod pollingMethod = new JavaMethod(method.getInterface());
+        pollingMethod.setAsync(true);
+        pollingMethod.setName(method.getName() + ToolConstants.ASYNC_METHOD_SUFFIX);
+        pollingMethod.setStyle(method.getStyle());
+        pollingMethod.setWrapperStyle(method.isWrapperStyle());
+        pollingMethod.setSoapAction(method.getSoapAction());
+        pollingMethod.setOperationName(method.getOperationName());
 
         JavaReturn response = new JavaReturn();
         response.setClassName(getAsyncClassName(method, "Response"));
-        callbackMethod.setReturn(response);
+        pollingMethod.setReturn(response);
 
         // REVISIT: test the operation name in the annotation
-        callbackMethod.annotate(new WebMethodAnnotator());
-        callbackMethod.addAnnotation("RequestWrapper", method.getAnnotationMap().get("RequestWrapper"));
-        callbackMethod.addAnnotation("ResponseWrapper", method.getAnnotationMap().get("ResponseWrapper"));
-        callbackMethod.addAnnotation("SOAPBinding", method.getAnnotationMap().get("SOAPBinding"));
+        pollingMethod.annotate(new WebMethodAnnotator());
+        pollingMethod.addAnnotation("RequestWrapper", method.getAnnotationMap().get("RequestWrapper"));
+        pollingMethod.addAnnotation("ResponseWrapper", method.getAnnotationMap().get("ResponseWrapper"));
+        pollingMethod.addAnnotation("SOAPBinding", method.getAnnotationMap().get("SOAPBinding"));
 
         for (Iterator iter = method.getParameters().iterator(); iter.hasNext();) {
-            callbackMethod.addParameter((JavaParameter)iter.next());
+            pollingMethod.addParameter((JavaParameter)iter.next());
         }
 
-        method.getInterface().addMethod(callbackMethod);
+        method.getInterface().addMethod(pollingMethod);
     }
 
     private String getAsyncClassName(JavaMethod method, String clzName) {

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java Thu Oct 25 10:09:20 2007
@@ -186,7 +186,8 @@
         MessagePartInfo part = inputParts.iterator().next();
 
         List<QName> wrappedElements = ProcessorUtil.getWrappedElementQNames(context, part.getElementQName());
-        if (wrappedElements == null || wrappedElements.size() == 0) {
+        if ((wrappedElements == null || wrappedElements.size() == 0) 
+            && countOutOfBandHeader(inputMessage) == 0) {
             return;
         }
         boolean isSchemaQualified = ProcessorUtil.isSchemaFormQualified(context, part.getElementQName());
@@ -201,9 +202,9 @@
         }
 
         // Adding out of band headers
-        if (countOutOfBandHeader(inputMessage) > 0) {
+        if (requireOutOfBandHeader() && countOutOfBandHeader(inputMessage) > 0) {
             for (MessagePartInfo hpart : inputMessage.getMessageParts()) {
-                if (!isOutOfBandHeader(hpart) || !requireOutOfBandHeader()) {
+                if (!isOutOfBandHeader(hpart)) {
                     continue;
                 }
                 addParameter(method, getParameterFromPart(hpart, JavaType.Style.IN));
@@ -531,6 +532,7 @@
         // first for the ordered list
         int index = 0;
         int size = parameterList.size();
+
         while (index < size) {
             String partName = parameterList.get(index);
             MessagePartInfo part = inputPartsMap.get(inputMessage.getMessagePartQName(partName));

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java Thu Oct 25 10:09:20 2007
@@ -25,6 +25,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+
 import javax.wsdl.extensions.ExtensibilityElement;
 import javax.wsdl.extensions.http.HTTPBinding;
 import javax.wsdl.extensions.mime.MIMEContent;
@@ -52,7 +53,8 @@
 import org.apache.cxf.tools.common.extensions.soap.SoapBody;
 import org.apache.cxf.tools.common.extensions.soap.SoapHeader;
 import org.apache.cxf.tools.common.extensions.soap.SoapOperation;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.JavaModel;
@@ -377,9 +379,9 @@
                 }
 
                 if (headerType == this.resultHeader) {
-                    JavaAnnotation resultAnno = jm.getAnnotationMap().get("WebResult");
+                    JAnnotation resultAnno = jm.getAnnotationMap().get("WebResult");
                     if (resultAnno != null) {
-                        resultAnno.addArgument("header", "true", "");
+                        resultAnno.addElement(new JAnnotationElement("header", true, true));
                     }
                 }
                 processParameter(jm, bop);
@@ -389,9 +391,12 @@
 
     private void setParameterAsHeader(JavaParameter parameter) {
         parameter.setHeader(true);
-        parameter.getAnnotation().addArgument("header", "true", "");
-        parameter.getAnnotation().addArgument("name", parameter.getQName().getLocalPart());
-        parameter.getAnnotation().addArgument("targetNamespace", parameter.getTargetNamespace());
+        JAnnotation parameterAnnotation = parameter.getAnnotation();
+        parameterAnnotation.addElement(new JAnnotationElement("header", true, true));
+        parameterAnnotation.addElement(new JAnnotationElement("name", 
+                                                                     parameter.getQName().getLocalPart()));
+        parameterAnnotation.addElement(new JAnnotationElement("targetNamespace", 
+                                                                     parameter.getTargetNamespace()));
     }
 
     private void processParameter(JavaMethod jm, BindingOperationInfo operation) throws ToolException {

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/BindingAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/BindingAnnotator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/BindingAnnotator.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/BindingAnnotator.java Thu Oct 25 10:09:20 2007
@@ -19,15 +19,14 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator;
 
-import java.util.*;
 import javax.jws.soap.SOAPBinding;
 
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaMethod;
-import org.apache.cxf.tools.util.SOAPBindingUtil;
 
 public final class BindingAnnotator implements Annotator {
     
@@ -40,22 +39,18 @@
         }
         
         if (processBinding(intf)) {
-            JavaAnnotation bindingAnnotation = new JavaAnnotation("SOAPBinding");
+            JAnnotation bindingAnnotation = new JAnnotation(SOAPBinding.class);
             if (!SOAPBinding.Style.DOCUMENT.equals(intf.getSOAPStyle())) {
-                String style = SOAPBindingUtil.getBindingAnnotation(intf.getSOAPStyle().toString());
-                bindingAnnotation.addArgument("style", style, "");                
+                bindingAnnotation.addElement(new JAnnotationElement("style", intf.getSOAPStyle()));
             }
             if (!SOAPBinding.Use.LITERAL.equals(intf.getSOAPUse())) {
-                String use = SOAPBindingUtil.getBindingAnnotation(intf.getSOAPUse().toString());
-                bindingAnnotation.addArgument("use", use, "");
+                bindingAnnotation.addElement(new JAnnotationElement("use", intf.getSOAPUse()));
             }            
             if (intf.getSOAPStyle() == SOAPBinding.Style.DOCUMENT) {
-                String parameterStyle = SOAPBindingUtil.getBindingAnnotation(intf.
-                                                                             getSOAPParameterStyle().
-                                                                             toString());
-                bindingAnnotation.addArgument("parameterStyle", parameterStyle, "");
+                bindingAnnotation.addElement(new JAnnotationElement("parameterStyle", 
+                                                                           intf.getSOAPParameterStyle()));
             }
-            intf.addAnnotation(bindingAnnotation.toString());
+            intf.addAnnotation(bindingAnnotation);
         }
     }
     

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/SoapBindingAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/SoapBindingAnnotator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/SoapBindingAnnotator.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/SoapBindingAnnotator.java Thu Oct 25 10:09:20 2007
@@ -20,11 +20,12 @@
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator;
 
 import javax.jws.soap.SOAPBinding;
+
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaMethod;
-import org.apache.cxf.tools.util.SOAPBindingUtil;
 
 public class SoapBindingAnnotator implements Annotator {
 
@@ -39,15 +40,15 @@
             if (!method.isWrapperStyle()
                 && !SOAPBinding.ParameterStyle.BARE.equals(method.getInterface().getSOAPParameterStyle())) {
             
-                JavaAnnotation bindingAnnotation = new JavaAnnotation("SOAPBinding");
-                bindingAnnotation.addArgument("parameterStyle",
-                                              SOAPBindingUtil.getBindingAnnotation("BARE"), "");
+                JAnnotation bindingAnnotation = new JAnnotation(SOAPBinding.class);
+                bindingAnnotation.addElement(new JAnnotationElement("parameterStyle", 
+                                                                           SOAPBinding.ParameterStyle.BARE));
                 method.addAnnotation("SOAPBinding", bindingAnnotation);
             } else if (method.isWrapperStyle()
                 && SOAPBinding.ParameterStyle.BARE.equals(method.getInterface().getSOAPParameterStyle())) {
-                JavaAnnotation bindingAnnotation = new JavaAnnotation("SOAPBinding");
-                bindingAnnotation.addArgument("parameterStyle",
-                                              SOAPBindingUtil.getBindingAnnotation("WRAPPED"), "");
+                JAnnotation bindingAnnotation = new JAnnotation(SOAPBinding.class);
+                bindingAnnotation.addElement(new JAnnotationElement("parameterStyle", 
+                                                                        SOAPBinding.ParameterStyle.WRAPPED));
                 method.addAnnotation("SOAPBinding", bindingAnnotation);                
             }
         }

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebMethodAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebMethodAnnotator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebMethodAnnotator.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebMethodAnnotator.java Thu Oct 25 10:09:20 2007
@@ -19,10 +19,13 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator;
 
+import javax.jws.WebMethod;
+
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaMethod;
 
 public class WebMethodAnnotator implements Annotator {
@@ -35,15 +38,14 @@
             throw new RuntimeException("WebMethod can only annotate JavaMethod");
         }
         String operationName = method.getOperationName();
-        JavaAnnotation methodAnnotation = new JavaAnnotation("WebMethod");
+        JAnnotation methodAnnotation = new JAnnotation(WebMethod.class);
         
         if (!method.getName().equals(operationName)) {
-            methodAnnotation.addArgument("operationName", operationName);
+            methodAnnotation.addElement(new JAnnotationElement("operationName", operationName));
         }
         if (!StringUtils.isEmpty(method.getSoapAction())) {
-            methodAnnotation.addArgument("action", method.getSoapAction());
+            methodAnnotation.addElement(new JAnnotationElement("action", method.getSoapAction()));
         }
         method.addAnnotation("WebMethod", methodAnnotation);
-        method.getInterface().addImport("javax.jws.WebMethod");
     }
 }

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java Thu Oct 25 10:09:20 2007
@@ -19,11 +19,13 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator;
 
+import javax.jws.WebParam;
 import javax.jws.soap.SOAPBinding;
 
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.JavaParameter;
 import org.apache.cxf.tools.common.model.JavaType;
@@ -45,7 +47,7 @@
             }
         }
 
-        JavaAnnotation webParamAnnotation = new JavaAnnotation("WebParam");
+        JAnnotation webParamAnnotation = new JAnnotation(WebParam.class);
         String name = parameter.getName();
         String targetNamespace = method.getInterface().getNamespace();
         String partName = null;
@@ -68,14 +70,18 @@
         }
 
         if (partName != null) {
-            webParamAnnotation.addArgument("partName", partName);
+            webParamAnnotation.addElement(new JAnnotationElement("partName", partName));
         }
-        if (parameter.getStyle() == JavaType.Style.OUT || parameter.getStyle() == JavaType.Style.INOUT) {
-            webParamAnnotation.addArgument("mode", "Mode." + parameter.getStyle().toString(), "");
-        }
-        webParamAnnotation.addArgument("name", name);
-        if (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT || parameter.isHeader()) {
-            webParamAnnotation.addArgIgnoreEmpty("targetNamespace", targetNamespace, "\"");
+        if (parameter.getStyle() == JavaType.Style.OUT) {
+            webParamAnnotation.addElement(new JAnnotationElement("mode", WebParam.Mode.OUT));
+        } else if (parameter.getStyle() == JavaType.Style.INOUT) {
+            webParamAnnotation.addElement(new JAnnotationElement("mode", WebParam.Mode.INOUT));
+        }
+        webParamAnnotation.addElement(new JAnnotationElement("name", name));
+        if (null != targetNamespace 
+                && (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT || parameter.isHeader())) {        
+            webParamAnnotation.addElement(new JAnnotationElement("targetNamespace", 
+                                                                        targetNamespace));        
         }
 
         parameter.setAnnotation(webParamAnnotation);

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebResultAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebResultAnnotator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebResultAnnotator.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebResultAnnotator.java Thu Oct 25 10:09:20 2007
@@ -19,10 +19,14 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator;
 
+import javax.jws.Oneway;
+import javax.jws.WebResult;
 import javax.jws.soap.SOAPBinding;
+
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaMethod;
 
 public class WebResultAnnotator implements Annotator {
@@ -36,16 +40,15 @@
         }
             
         if (method.isOneWay()) {
-            JavaAnnotation oneWayAnnotation = new JavaAnnotation("Oneway");
+            JAnnotation oneWayAnnotation = new JAnnotation(Oneway.class);
             method.addAnnotation("Oneway", oneWayAnnotation);
-            method.getInterface().addImport("javax.jws.Oneway");
             return;
         }
 
         if ("void".equals(method.getReturn().getType())) {
             return;
         }
-        JavaAnnotation resultAnnotation = new JavaAnnotation("WebResult");
+        JAnnotation resultAnnotation = new JAnnotation(WebResult.class);
         String targetNamespace = method.getReturn().getTargetNamespace();
         String name = "return";
 
@@ -66,13 +69,15 @@
         }
 
         
-        
-        resultAnnotation.addArgument("name", name);
-        resultAnnotation.addArgIgnoreEmpty("targetNamespace", targetNamespace, "\"");
+        resultAnnotation.addElement(new JAnnotationElement("name", name));
+        if (null != targetNamespace) {
+            resultAnnotation.addElement(new JAnnotationElement("targetNamespace", targetNamespace));
+        }
 
         if (method.getSoapStyle() == SOAPBinding.Style.RPC
             || (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT && !method.isWrapperStyle())) {
-            resultAnnotation.addArgument("partName", method.getReturn().getName());
+            resultAnnotation.addElement(new JAnnotationElement("partName", 
+                                                                      method.getReturn().getName()));
         }
 
         method.addAnnotation("WebResult", resultAnnotation);

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebServiceAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebServiceAnnotator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebServiceAnnotator.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebServiceAnnotator.java Thu Oct 25 10:09:20 2007
@@ -19,9 +19,12 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator;
 
+import javax.jws.WebService;
+
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaInterface;
 
 public final class WebServiceAnnotator implements Annotator {
@@ -33,12 +36,12 @@
         } else {
             throw new RuntimeException("WebService can only annotate JavaInterface");
         }
-        JavaAnnotation serviceAnnotation = new JavaAnnotation("WebService");
-        serviceAnnotation.addArgument("targetNamespace", intf.getNamespace());
-        //serviceAnnotation.addArgument("wsdlLocation", intf.getLocation());
-        serviceAnnotation.addArgument("name", intf.getWebServiceName());
+        JAnnotation serviceAnnotation = new JAnnotation(WebService.class);
+        serviceAnnotation.addElement(new JAnnotationElement("targetNamespace", 
+                                                                   intf.getNamespace()));
+        serviceAnnotation.addElement(new JAnnotationElement("name", intf.getWebServiceName()));
         
-        intf.addAnnotation(serviceAnnotation.toString());
+        intf.addAnnotation(serviceAnnotation);
     }
 }
 

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WrapperAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WrapperAnnotator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WrapperAnnotator.java (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WrapperAnnotator.java Thu Oct 25 10:09:20 2007
@@ -19,9 +19,16 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator;
 
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.JavaParameter;
 
@@ -42,20 +49,27 @@
             throw new RuntimeException("RequestWrapper and ResponseWrapper can only annotate JavaMethod");
         }
         if (wrapperRequest != null) {
-            JavaAnnotation wrapperRequestAnnotation = new JavaAnnotation("RequestWrapper");
-            wrapperRequestAnnotation.addArgument("localName", wrapperRequest.getType());
-            wrapperRequestAnnotation.addArgument("targetNamespace", wrapperRequest.getTargetNamespace());
-            wrapperRequestAnnotation.addArgument("className", wrapperRequest.getClassName());
-            method.addAnnotation("RequestWrapper", wrapperRequestAnnotation);
-            method.getInterface().addImport("javax.xml.ws.RequestWrapper");
+            JAnnotation requestAnnotation = new JAnnotation(RequestWrapper.class);
+            requestAnnotation.addElement(new JAnnotationElement("localName",
+                                                                       wrapperRequest.getType()));
+            requestAnnotation.addElement(new JAnnotationElement("targetNamespace",
+                                                                       wrapperRequest.getTargetNamespace()));
+            requestAnnotation.addElement(new JAnnotationElement("className", 
+                                                                       wrapperRequest.getClassName()));
+
+            method.addAnnotation("RequestWrapper", requestAnnotation);
+            method.getInterface().addImports(requestAnnotation.getImports());
         }
         if (wrapperResponse != null) {
-            JavaAnnotation wrapperResponseAnnotation = new JavaAnnotation("ResponseWrapper");
-            wrapperResponseAnnotation.addArgument("localName", wrapperResponse.getType());
-            wrapperResponseAnnotation.addArgument("targetNamespace", wrapperResponse.getTargetNamespace());
-            wrapperResponseAnnotation.addArgument("className", wrapperResponse.getClassName());
-            method.addAnnotation("ResponseWrapper", wrapperResponseAnnotation);
-            method.getInterface().addImport("javax.xml.ws.ResponseWrapper");
+            List<JAnnotationElement> elements = new ArrayList<JAnnotationElement>();
+            elements.add(new JAnnotationElement("localName", wrapperResponse.getType()));
+            elements.add(new JAnnotationElement("targetNamespace", wrapperResponse.getTargetNamespace()));
+            elements.add(new JAnnotationElement("className", wrapperResponse.getClassName()));
+
+            JAnnotation responseAnnotation = new JAnnotation(ResponseWrapper.class);
+            responseAnnotation.getElements().addAll(elements);
+            method.addAnnotation("ResponseWrapper", responseAnnotation);
+            method.getInterface().addImports(responseAnnotation.getImports());
         }
     }
 }

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/build.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/build.vm?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/build.vm (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/build.vm Thu Oct 25 10:09:20 2007
@@ -18,7 +18,7 @@
 <!--
      Generated by WSDLToJava Compiler.
      /**
-     * This class was generated by the cxf $version
+     * This class was generated by $fullversion
      * $currentdate
      * Generated source version: $version
      *

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm Thu Oct 25 10:09:20 2007
@@ -29,9 +29,12 @@
 #if ($service.PackageName != $intf.PackageName) 
 import ${service.PackageName}.${service.Name};
 #end
+#foreach ($import in $intf.Imports)
+import ${import};
+#end
 
 /**
- * This class was generated by the CXF $version
+ * This class was generated by $fullversion
  * $currentdate
  * Generated source version: $version
  * 
@@ -66,7 +69,7 @@
         $intf.Name port = ss.get${port.Name}();  
         
 #foreach ($method in $intf.Methods)
-
+        {
         System.out.println("Invoking ${method.Name}...");
 #foreach ($parameter in $method.Parameters)
 #set($paramValueName = "_${method.Name}_${parameter.Name}")
@@ -90,6 +93,7 @@
 #if($method.return.Type != "void")
 ${indent}System.out.println("${method.Name}.result=" + _${method.Name}__return);
 #end
+
 #foreach ($parameter in $method.Parameters)
 #if ($parameter.Style.toString() != "IN")
 #set($paramValueName = "_${method.Name}_${parameter.Name}")
@@ -104,8 +108,9 @@
         }#end
 #end        
 
+${indent}}
 #end
-        
+
         System.exit(0);
     }
 

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/fault.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/fault.vm?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/fault.vm (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/fault.vm Thu Oct 25 10:09:20 2007
@@ -21,7 +21,7 @@
 
 
 /**
- * This class was generated by the CXF $version
+ * This class was generated by $fullversion
  * $currentdate
  * Generated source version: $version
  * 
@@ -37,16 +37,24 @@
     
     $field.Modifier $field.ClassName $paraName;
 
-    public $expClass.Name (String message) {
+    public ${expClass.Name}() {
+        super();
+    }
+    
+    public ${expClass.Name}(String message) {
         super(message);
     }
+    
+    public ${expClass.Name}(String message, Throwable cause) {
+        super(message, cause);
+    }
 
-    public $expClass.Name (String message, $field.ClassName $paraName) {
+    public ${expClass.Name}(String message, $field.ClassName $paraName) {
         super(message);
         this.$paraName = $paraName;
     }
 
-    public $expClass.Name (String message, $field.ClassName $paraName, Throwable cause) {
+    public ${expClass.Name}(String message, $field.ClassName $paraName, Throwable cause) {
         super(message, cause);
         this.$paraName = $paraName;
     }

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm Thu Oct 25 10:09:20 2007
@@ -28,7 +28,7 @@
 #end
 
 /**
- * This class was generated by the CXF $version
+ * This class was generated by $fullversion
  * $currentdate
  * Generated source version: $version
  * 
@@ -49,6 +49,10 @@
      * @see $intf.PackageName.$intf.Name#${method.Name}(#foreach ($parameter in $method.Parameters)$parameter.ClassName  $parameter.Name #if ($velocityCount != $method.getParameters().size()),#end)#end*
      */
     public $method.return.ClassName ${method.Name}(#if($method.ParameterListWithoutAnnotation.size() == 0))#end#if($method.ParameterListWithoutAnnotation.size() != 0)#foreach($param in ${method.ParameterListWithoutAnnotation})$param#end)#end#if($method.Exceptions.size() > 0) throws #foreach($exception in $method.Exceptions)$exception.ClassName #if($velocityCount != $method.Exceptions.size()),#end #end #end { 
+#if ($method.Async)
+       return null;
+       /* not called */
+#else
         LOG.info("Executing operation $method.Name");
 #foreach ($parameter in $method.Parameters)
 #if ($parameter.Style.toString() == "IN")
@@ -76,6 +80,7 @@
 #if ($method.Exceptions.size() > 0) 
 #foreach($exception in $method.Exceptions)
         //throw new ${exception.ClassName}("${exception.Name}...");
+#end
 #end
 #end
     }

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/sei.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/sei.vm?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/sei.vm (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/sei.vm Thu Oct 25 10:09:20 2007
@@ -17,17 +17,12 @@
 
 package $intf.PackageName;
 
-import javax.jws.WebParam.Mode;
-import javax.jws.WebParam;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding.Style;
-import javax.jws.soap.SOAPBinding;
 #foreach ($import in $intf.Imports)
 import ${import};
 #end
 
 /**
- * This class was generated by the CXF $version
+ * This class was generated by $fullversion
  * $currentdate
  * Generated source version: $version
  * 
@@ -43,7 +38,7 @@
 #foreach ($annotation in $method.Annotations)
     $annotation
 #end
-    public $method.return.ClassName ${method.Name}(#if($method.ParameterList.size() == 0))#end
+    public $method.returnValue ${method.Name}(#if($method.ParameterList.size() == 0))#end
 #if($method.ParameterList.size() != 0)
 
 #foreach ($param in ${method.ParameterList})

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/server.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/server.vm?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/server.vm (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/server.vm Thu Oct 25 10:09:20 2007
@@ -20,7 +20,7 @@
 import javax.xml.ws.Endpoint;
 
 /**
- * This class was generated by the CXF $version
+ * This class was generated by $fullversion
  * $currentdate
  * Generated source version: $version
  * 

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm Thu Oct 25 10:09:20 2007
@@ -23,15 +23,13 @@
 import javax.xml.ws.Service;
 import javax.xml.ws.WebEndpoint;
 import javax.xml.ws.WebServiceClient;
-#foreach ($port in ${service.Ports})    
-import ${port.PackageName}.${port.InterfaceClass};
-#end
+import javax.xml.ws.WebServiceFeature;
 #foreach ($import in ${service.Imports}) 
 import ${import};
 #end
 
 /**
- * This class was generated by the CXF $version
+ * This class was generated by $fullversion
  * $currentdate
  * Generated source version: $version
  * 
@@ -59,6 +57,10 @@
         WSDL_LOCATION = url;
     }
 
+    public ${service.Name}(URL wsdlLocation) {
+        super(wsdlLocation, SERVICE);
+    }
+
     public ${service.Name}(URL wsdlLocation, QName serviceName) {
         super(wsdlLocation, serviceName);
     }
@@ -71,11 +73,23 @@
     /**
      * 
      * @return
-     *     returns ${port.Name}
+     *     returns ${port.InterfaceClass}
      */
     @WebEndpoint(name = "${port.PortName}")
     public ${port.InterfaceClass} get${port.Name}() {
         return (${port.InterfaceClass})super.getPort($port.Name, ${port.InterfaceClass}.class);
+    }
+
+    /**
+     * 
+     * @param features
+     *     A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.
+     * @return
+     *     returns ${port.InterfaceClass}
+     */
+    @WebEndpoint(name = "${port.PortName}")
+    public ${port.InterfaceClass} get${port.Name}(WebServiceFeature... features) {
+        return (${port.InterfaceClass})super.getPort($port.Name, ${port.InterfaceClass}.class, features);
     }
 #end
 

Modified: incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/Messages.properties?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/Messages.properties (original)
+++ incubator/cxf/branches/jliu/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/Messages.properties Thu Oct 25 10:09:20 2007
@@ -1,2 +1,22 @@
+#
+#
+#    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.
+#
+#
 NON_UNIQUE_BODY = Non unique body parts! In a port, operations must have unique operation signaure on the wire for successful dispatch. In port {0}, Operations \"{1}\" and \"{2}\" have the same request body block {3}  
 WRAPPER_STYLE_NAME_COLLISION = Element {0} has Having the same name with different types[{1} -- {2}],  In wrapper style, there is a collision as per the spec.



Mime
View raw message