You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bi...@apache.org on 2007/12/07 16:08:09 UTC

svn commit: r602118 - in /incubator/cxf/trunk/tools/wsdlto/frontend/javascript: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/cxf/ src/main/java/org/apache/cxf/tools/ src/main/java/org/apache/cxf...

Author: bimargulies
Date: Fri Dec  7 07:08:07 2007
New Revision: 602118

URL: http://svn.apache.org/viewvc?rev=602118&view=rev
Log:
Rough out the wsdl2js feature. 

Added:
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/pom.xml   (with props)
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java   (with props)
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptProfile.java   (with props)
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScript.java   (with props)
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptProcessor.java   (with props)
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml   (with props)
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/resources/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java   (with props)
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/hello_world.wsdl   (with props)
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/resources/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/resources/org/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/resources/org/apache/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/resources/org/apache/cxf/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/resources/org/apache/cxf/tools/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/resources/org/apache/cxf/tools/wsdlto/
    incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/resources/org/apache/cxf/tools/wsdlto/javascript/

Added: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/javascript/pom.xml?rev=602118&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/javascript/pom.xml (added)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/javascript/pom.xml Fri Dec  7 07:08:07 2007
@@ -0,0 +1,81 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements. See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership. The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License. You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied. See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cxf</groupId>
+    <artifactId>cxf-tools-wsdlto-frontend-javascript</artifactId>
+    <packaging>jar</packaging>
+    <version>2.1-incubator-SNAPSHOT</version>
+    <name>Apache CXF Command Line Tools WSDL to JavaScript Front End</name>
+    <url>http://cwiki.apache.org/CXF</url>
+
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-parent</artifactId>
+        <version>2.1-incubator-SNAPSHOT</version>
+        <relativePath>../../../../parent/pom.xml</relativePath>
+    </parent>
+
+    <dependencies>
+        <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-rt-core</artifactId>
+            <version>${project.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.cxf</groupId>
+                    <artifactId>cxf-testutils</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-tools-wsdlto-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-javascript</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+    </dependencies>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/cxf/trunk/tools/wsdlto/frontend/javascript</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/cxf/trunk/tools/wsdlto/frontend/javascript</developerConnection>
+      <url>http://svn.apache.org/viewvc/incubator/cxf/trunk/cxf-parent/cxf-tools-wsdlto-frontend-javascript</url>
+  </scm>
+
+
+
+</project>

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java?rev=602118&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java (added)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java Fri Dec  7 07:08:07 2007
@@ -0,0 +1,342 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.javascript;
+
+import java.io.File;
+import java.io.IOException;
+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.Properties;
+import java.util.Set;
+import java.util.logging.Level;
+
+import javax.wsdl.Definition;
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.util.PropertiesLoaderUtils;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.resource.URIResolver;
+import org.apache.cxf.service.model.InterfaceInfo;
+import org.apache.cxf.service.model.SchemaInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.tools.common.ClassNameProcessor;
+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.common.toolspec.parser.CommandDocument;
+import org.apache.cxf.tools.common.toolspec.parser.ErrorVisitor;
+import org.apache.cxf.tools.util.ClassCollector;
+import org.apache.cxf.tools.util.URIParserUtil;
+import org.apache.cxf.tools.validator.ServiceValidator;
+import org.apache.cxf.tools.wsdlto.WSDLToJavaContainer;
+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.tools.wsdlto.core.PluginLoader;
+import org.apache.cxf.wsdl.WSDLConstants;
+import org.apache.cxf.wsdl11.WSDLServiceBuilder;
+
+public class JavaScriptContainer extends WSDLToJavaContainer {
+
+    private static final String TOOL_NAME = "wsdl2js";
+    private static final String SERVICE_VALIDATOR = "META-INF/tools.service.validator.xml";
+
+    public JavaScriptContainer(ToolSpec toolspec) throws Exception {
+        super(TOOL_NAME, toolspec);
+    }
+
+    public Set<String> getArrayKeys() {
+        Set<String> set = new HashSet<String>();
+        set.add(ToolConstants.CFG_JSPACKAGEPREFIX);
+        return set;
+    }
+
+    public WSDLConstants.WSDLVersion getWSDLVersion() {
+        String version = (String)context.get(ToolConstants.CFG_WSDL_VERSION);
+        return WSDLConstants.getVersion(version);
+    }
+
+    @SuppressWarnings("unchecked")
+    public void execute() throws ToolException {
+        buildToolContext();
+        validate(context);
+
+        WSDLConstants.WSDLVersion version = getWSDLVersion();
+
+        String wsdlURL = (String)context.get(ToolConstants.CFG_WSDLURL);
+        List<ServiceInfo> serviceList = (List<ServiceInfo>)context.get(ToolConstants.SERVICE_LIST);
+        if (serviceList == null) {
+            serviceList = new ArrayList<ServiceInfo>();
+
+            PluginLoader pluginLoader = PluginLoader.getInstance();
+            // for JavaScript generation, we always use JAX-WS.
+            FrontEndProfile frontend = pluginLoader.getFrontEndProfile("jaxws");
+
+            // Build the ServiceModel from the WSDLModel
+            if (version == WSDLConstants.WSDLVersion.WSDL11) {
+                AbstractWSDLBuilder<Definition> builder = (AbstractWSDLBuilder<Definition>)frontend
+                    .getWSDLBuilder();
+                builder.setContext(context);
+                builder.setBus(getBus());
+                context.put(Bus.class, getBus());
+                builder.build(URIParserUtil.getAbsoluteURI(wsdlURL));
+                builder.customize();
+                Definition definition = builder.getWSDLModel();
+
+                context.put(Definition.class, definition);
+
+                builder.validate(definition);
+
+                WSDLServiceBuilder serviceBuilder = new WSDLServiceBuilder(getBus());
+                serviceBuilder.setCatalogResolvedMap(builder.getCataLogResolvedMap());
+                String serviceName = (String)context.get(ToolConstants.CFG_SERVICENAME);
+
+                if (serviceName != null) {
+                    List<ServiceInfo> services = serviceBuilder.buildServices(definition,
+                                                                              getServiceQName(definition));
+                    serviceList.addAll(services);
+                } else if (definition.getServices().size() > 0) {
+                    serviceList = serviceBuilder.buildServices(definition);
+                } else {
+                    serviceList = serviceBuilder.buildMockServices(definition);
+                }
+
+            } else {
+                // TODO: wsdl2.0 support
+            }
+        }
+        Map<String, InterfaceInfo> interfaces = new HashMap<String, InterfaceInfo>();
+
+        Map<String, Element> schemas = (Map<String, Element>)serviceList.get(0)
+            .getProperty(WSDLServiceBuilder.WSDL_SCHEMA_ELEMENT_LIST);
+        if (schemas == null) {
+            schemas = new java.util.HashMap<String, Element>();
+            ServiceInfo serviceInfo = serviceList.get(0);
+            for (SchemaInfo schemaInfo : serviceInfo.getSchemas()) {
+                if (schemaInfo.getElement() != null && schemaInfo.getSystemId() == null) {
+                    String sysId = schemaInfo.getElement().getAttribute("targetNamespce");
+                    if (sysId == null) {
+                        sysId = serviceInfo.getTargetNamespace();
+                    }
+                    schemas.put(sysId, schemaInfo.getElement());
+                }
+                if (schemaInfo.getElement() != null && schemaInfo.getSystemId() != null) {
+                    schemas.put(schemaInfo.getSystemId(), schemaInfo.getElement());
+                }
+            }
+        }
+        context.put(ToolConstants.SCHEMA_MAP, schemas);
+        context.put(ToolConstants.PORTTYPE_MAP, interfaces);
+        context.put(ClassCollector.class, new ClassCollector());
+        WSDLToJavaScriptProcessor processor = new WSDLToJavaScriptProcessor();
+
+        for (ServiceInfo service : serviceList) {
+
+            context.put(ServiceInfo.class, service);
+
+            validate(service);
+
+            processor.setEnvironment(context);
+            processor.process();
+        }
+    }
+
+    public void execute(boolean exitOnFinish) throws ToolException {
+        try {
+            if (getArgument() != null) {
+                super.execute(exitOnFinish);
+            }
+            execute();
+
+        } catch (ToolException ex) {
+            if (ex.getCause() instanceof BadUsageException) {
+                printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
+            }
+            throw ex;
+        } catch (Exception ex) {
+            throw new ToolException(ex);
+        } finally {
+            tearDown();
+        }
+    }
+
+    public void setNamespaceJavascriptPrefixes(ToolContext env) {
+        Map<String, String> nsPrefixMap = new HashMap<String, String>();
+        if (env.get(ToolConstants.CFG_JSPACKAGEPREFIX) != null) {
+            String[] pns = null;
+            try {
+                pns = (String[])env.get(ToolConstants.CFG_JSPACKAGEPREFIX);
+            } catch (ClassCastException e) {
+                pns = new String[1];
+                pns[0] = (String)env.get(ToolConstants.CFG_JSPACKAGEPREFIX);
+            }
+            for (int j = 0; j < pns.length; j++) {
+                int pos = pns[j].indexOf("=");
+                String jsprefix = pns[j];
+                if (pos != -1) {
+                    String ns = pns[j].substring(0, pos);
+                    jsprefix = pns[j].substring(pos + 1);
+                    nsPrefixMap.put(ns, jsprefix);
+                } else {
+                    nsPrefixMap.put("&tns&", jsprefix);
+                }
+            }
+            env.put(ToolConstants.CFG_JSPREFIXMAP, nsPrefixMap);
+        }
+    }
+
+    public void validate(ToolContext env) throws ToolException {
+        String outdir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
+        if (outdir != null) {
+            File dir = new File(outdir);
+            if (!dir.exists()) {
+                Message msg = new Message("DIRECTORY_NOT_EXIST", LOG, outdir);
+                throw new ToolException(msg);
+            }
+            if (!dir.isDirectory()) {
+                Message msg = new Message("NOT_A_DIRECTORY", LOG, outdir);
+                throw new ToolException(msg);
+            }
+        }
+
+        if (env.optionSet(ToolConstants.CFG_COMPILE)) {
+            String clsdir = (String)env.get(ToolConstants.CFG_CLASSDIR);
+            if (clsdir != null) {
+                File dir = new File(clsdir);
+                if (!dir.exists()) {
+                    Message msg = new Message("DIRECTORY_NOT_EXIST", LOG, clsdir);
+                    throw new ToolException(msg);
+                }
+            }
+        }
+
+        String wsdl = (String)env.get(ToolConstants.CFG_WSDLURL);
+        if (StringUtils.isEmpty(wsdl)) {
+            Message msg = new Message("NO_WSDL_URL", LOG);
+            throw new ToolException(msg);
+        }
+
+        env.put(ToolConstants.CFG_WSDLURL, URIParserUtil.normalize(wsdl));
+
+        String[] bindingFiles;
+        try {
+            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);
+        }
+
+        for (int i = 0; i < bindingFiles.length; i++) {
+            bindingFiles[i] = URIParserUtil.getAbsoluteURI(bindingFiles[i]);
+        }
+
+        env.put(ToolConstants.CFG_BINDING, bindingFiles);
+    }
+
+    public void buildToolContext() {
+        context = getContext();
+        context.addParameters(getParametersMap(getArrayKeys()));
+
+        if (context.get(ToolConstants.CFG_OUTPUTDIR) == null) {
+            context.put(ToolConstants.CFG_OUTPUTDIR, ".");
+        }
+
+        if (context.containsKey(ToolConstants.CFG_ANT)) {
+            setAntProperties(context);
+            setLibraryReferences(context);
+        }
+
+        if (!context.containsKey(ToolConstants.CFG_WSDL_VERSION)) {
+            context.put(ToolConstants.CFG_WSDL_VERSION, WSDLConstants.WSDL11);
+        }
+
+        context.put(ToolConstants.CFG_SUPPRESS_WARNINGS, true);
+        setNamespaceJavascriptPrefixes(context);
+    }
+
+    public void checkParams(ErrorVisitor errors) throws ToolException {
+        CommandDocument doc = super.getCommandDocument();
+
+        if (!doc.hasParameter("wsdlurl")) {
+            errors.add(new ErrorVisitor.UserError("WSDL/SCHEMA URL has to be specified"));
+        }
+        if (errors.getErrors().size() > 0) {
+            Message msg = new Message("PARAMETER_MISSING", LOG);
+            throw new ToolException(msg, new BadUsageException(getUsage(), errors));
+        }
+    }
+
+    public void validate(final ServiceInfo service) throws ToolException {
+        for (ServiceValidator validator : getServiceValidators()) {
+            service.setProperty(ToolContext.class.getName(), context);
+            validator.setService(service);
+            if (!validator.isValid()) {
+                throw new ToolException(validator.getErrorMessage());
+            }
+        }
+    }
+
+    public List<ServiceValidator> getServiceValidators() {
+        List<ServiceValidator> validators = new ArrayList<ServiceValidator>();
+
+        Properties initialExtensions = null;
+        try {
+            initialExtensions = PropertiesLoaderUtils.loadAllProperties(SERVICE_VALIDATOR, Thread
+                .currentThread().getContextClassLoader());
+        } catch (IOException ex) {
+            throw new RuntimeException(ex);
+        }
+
+        for (Iterator it = initialExtensions.values().iterator(); it.hasNext();) {
+            String validatorClass = (String)it.next();
+            try {
+                if (LOG.isLoggable(Level.FINE)) {
+                    LOG.fine("Found service validator : " + validatorClass);
+                }
+                ServiceValidator validator = (ServiceValidator)Class.forName(
+                                                                             validatorClass,
+                                                                             true,
+                                                                             Thread.currentThread()
+                                                                                 .getContextClassLoader())
+                    .newInstance();
+                validators.add(validator);
+            } catch (Exception ex) {
+                LOG.log(Level.WARNING, "EXTENSION_ADD_FAILED_MSG", ex);
+            }
+        }
+        return validators;
+    }
+}

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptProfile.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptProfile.java?rev=602118&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptProfile.java (added)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptProfile.java Fri Dec  7 07:08:07 2007
@@ -0,0 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.javascript;
+
+import org.apache.cxf.tools.wsdlto.core.FrontEndProfile;
+
+public class JavaScriptProfile extends FrontEndProfile {
+    
+}

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptProfile.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptProfile.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScript.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScript.java?rev=602118&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScript.java (added)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScript.java Fri Dec  7 07:08:07 2007
@@ -0,0 +1,128 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.javascript;
+
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.cxf.common.util.StringUtils;
+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.ToolContainer;
+import org.apache.cxf.tools.common.toolspec.ToolRunner;
+import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
+import org.apache.cxf.tools.wsdlto.core.FrontEndProfile;
+import org.apache.cxf.tools.wsdlto.core.PluginLoader;
+
+public class WSDLToJavaScript {
+
+
+    private String[] args;
+
+    public WSDLToJavaScript() {
+        args = new String[0];
+    }
+    public WSDLToJavaScript(String pargs[]) {
+        args = pargs;
+    }
+
+    private boolean isExitOnFinish() {
+        String exit = System.getProperty("exitOnFinish");
+        if (StringUtils.isEmpty(exit)) {
+            return false;
+        }
+        return "YES".equalsIgnoreCase(exit) || "TRUE".equalsIgnoreCase(exit);
+    }
+
+    public void run(ToolContext context) throws Exception {
+        if (args != null) {
+            context.put(ToolConstants.CFG_CMD_ARG, args);
+        }
+
+        InputStream toolspecStream = getResourceAsStream(WSDLToJavaScript.class, "javascript-toolspec.xml");
+
+        ToolRunner.runTool(JavaScriptContainer.class,
+                           toolspecStream,
+                           false,
+                           args,
+                           isExitOnFinish(),
+                           context);
+    }
+
+    protected boolean isVerbose() {
+        return isSet(new String[]{"-V", "-verbose"});
+    }
+
+    private boolean isSet(String[] keys) {
+        if (args == null) {
+            return false;
+        }
+        List<String> pargs = Arrays.asList(args);
+
+        for (String key : keys) {
+            if (pargs.contains(key)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public void setArguments(String[] pargs) {
+        args = pargs;
+    }
+
+    public static void main(String[] pargs) {
+
+        WSDLToJavaScript w2j = new WSDLToJavaScript(pargs);
+        try {
+
+            w2j.run(new ToolContext());
+
+        } catch (ToolException ex) {
+            System.err.println();
+            System.err.println("WSDLToJS Error : " + ex.getMessage());
+            System.err.println();
+            if (w2j.isVerbose()) {
+                ex.printStackTrace();
+            }
+            if (w2j.isExitOnFinish()) {
+                System.exit(1);
+            }
+        } catch (Exception ex) {
+            System.err.println("WSDLToJS Error : " + ex.getMessage());
+            System.err.println();
+            if (w2j.isVerbose()) {
+                ex.printStackTrace();
+            }
+            if (w2j.isExitOnFinish()) {
+                System.exit(1);
+            }
+        }
+        if (w2j.isExitOnFinish()) {
+            System.exit(0);
+        }
+    }
+
+    private static InputStream getResourceAsStream(Class clz, String file) {
+        return clz.getResourceAsStream(file);
+    }
+}

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScript.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScript.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptProcessor.java?rev=602118&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptProcessor.java (added)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptProcessor.java Fri Dec  7 07:08:07 2007
@@ -0,0 +1,98 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.javascript;
+
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.javascript.BasicNameManager;
+import org.apache.cxf.javascript.JavascriptQueryHandler;
+import org.apache.cxf.javascript.NamespacePrefixAccumulator;
+import org.apache.cxf.javascript.service.ServiceJavascriptBuilder;
+import org.apache.cxf.javascript.types.SchemaJavascriptBuilder;
+import org.apache.cxf.service.model.SchemaInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.tools.common.ClassNameProcessor;
+import org.apache.cxf.tools.common.ToolConstants;
+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;
+
+public class WSDLToJavaScriptProcessor extends WSDLToProcessor {
+    private static final Charset UTF8 = Charset.forName("utf-8");
+    
+    public void process() throws ToolException {
+        super.process();
+
+        ServiceInfo serviceInfo = context.get(ServiceInfo.class);
+
+        //File jsFile = getOutputFile(builder.getOutputFile(), serviceInfo.getName().getLocalPart() + ".js");
+        File jsFile = null;
+
+        BasicNameManager nameManager = new BasicNameManager(serviceInfo, null);
+        NamespacePrefixAccumulator prefixManager = new NamespacePrefixAccumulator(serviceInfo
+            .getXmlSchemaCollection());
+        Collection<SchemaInfo> schemata = serviceInfo.getSchemas();
+        try {
+            FileOutputStream fileOutputStream = new FileOutputStream(jsFile);
+            if (null != context.get(ToolConstants.CFG_JAVASCRIPT_UTILS)) {
+                JavascriptQueryHandler.writeUtilsToResponseStream(WSDLToJavaScriptProcessor.class, fileOutputStream);
+            }
+            
+            OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream, UTF8);
+            BufferedWriter writer = new BufferedWriter(outputStreamWriter);
+                
+            for (SchemaInfo schema : schemata) {
+                SchemaJavascriptBuilder jsBuilder = new SchemaJavascriptBuilder(serviceInfo
+                    .getXmlSchemaCollection(), prefixManager, nameManager, schema);
+                String allThatJavascript = jsBuilder.generateCodeForSchema(schema);
+                writer.append(allThatJavascript);
+            }
+
+            ServiceJavascriptBuilder serviceBuilder = new ServiceJavascriptBuilder(serviceInfo, prefixManager,
+                                                                                   nameManager);
+            serviceBuilder.walk();
+            String serviceJavascript = serviceBuilder.getCode();
+            writer.append(serviceJavascript);
+            writer.close();
+        } catch (FileNotFoundException e) {
+            throw new ToolException(e);
+        } catch (IOException e) {
+            throw new ToolException(e);
+        }
+
+    }
+}

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml?rev=602118&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml (added)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml Fri Dec  7 07:08:07 2007
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<toolspec xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xmlns:xhtml="http://www.w3.org/TR/xhtml1/strict"
+      xsi:schemaLocation="http://cxf.apache.org/Xutil/ToolSpecification http://cxf.apache.org/schema/xutil/tool-specification.xsd"
+      xmlns="http://cxf.apache.org/Xutil/ToolSpecification"
+      xmlns:ts="http://cxf.apache.org/Xutil/ToolSpecification">
+
+    <annotation>
+Examples:
+        wsdl2java -client HelloWorld.wsdl
+    </annotation>
+
+    <usage>
+        <optionGroup id="options">
+            <option id="wsdlversion" maxOccurs="unbounded">
+                <annotation>
+                    WSDL version, default is WSDL1.1
+                </annotation>
+                <switch>wv</switch>
+                <associatedArgument placement="afterSpace">
+                    <annotation>[wsdl version]</annotation>
+                </associatedArgument>
+            </option>
+
+            <option id="jspackageprefix" maxOccurs="unbounded">
+                <annotation>
+                    The JavaScript function name prefix to use for the generated code.
+					By default, this specifies the JavaScript prefix for use with the 
+					WSDL's TNS. You may optionally specify a namespace URI to specif
+					a prefix for other namespaces mentioned in the WSDL.
+                </annotation>
+                <switch>p</switch>
+                <associatedArgument placement="afterSpace">
+                    <valuetype>NameSpacePrefixString</valuetype>
+                    <annotation>[wsdl namespace =]prefix</annotation>
+                </associatedArgument>
+            </option>
+
+            <option id="catalog" maxOccurs="1">
+                <annotation>
+                    Specify catalog file to map the imported wsdl/schema
+                </annotation>
+                <switch>catalog</switch>
+                <associatedArgument placement="afterSpace">
+                    <annotation>catalog-file-name</annotation>
+                </associatedArgument>
+            </option>
+
+            <option id="outputdir" maxOccurs="1">
+                <annotation>
+                    The directory in which the code is placed</annotation>
+                <switch>d</switch>
+                <associatedArgument placement="afterSpace">
+                    <annotation>output-directory</annotation>
+                </associatedArgument>
+            </option>
+
+            <option id="client" maxOccurs="1">
+                <annotation>
+                    Generates the client code.</annotation>
+                <switch>client</switch>
+            </option>
+
+            <option id="validate" maxOccurs="1">
+                <annotation>
+                    To validate the wsdl before generating the code.  Usage of 
+                    this option is highly recommended.
+                </annotation>
+                <switch>validate</switch>
+            </option>
+
+        </optionGroup>
+        <optionGroup id="common_options">
+            <option id="help" maxOccurs="1">
+                <annotation>
+                    Display detailed information for options.</annotation>
+                <switch>h</switch>
+                <switch>?</switch>
+                <switch>help</switch>
+            </option>
+
+            <option id="version">
+                <annotation>
+                    Display the version of the tool.</annotation>
+                <switch>v</switch>
+            </option>
+
+            <option id="verbose">
+                <annotation>
+                    Verbose mode</annotation>
+                <switch>verbose</switch>
+                <switch>V</switch>
+            </option>
+
+            <option id="quiet">
+                <annotation>
+                    Quiet mode</annotation>
+                <switch>quiet</switch>
+                <switch>q</switch>
+            </option>
+
+        </optionGroup>
+        <argument id="wsdlurl" minOccurs="1" maxOccurs="1">
+            <annotation>
+                WSDL URL</annotation>
+        </argument>
+    </usage>
+</toolspec>

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java?rev=602118&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java (added)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java Fri Dec  7 07:08:07 2007
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.javascript;
+
+import java.net.URISyntaxException;
+
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * 
+ */
+@org.junit.Ignore
+public class WSDLToJavaScriptTest extends Assert {
+    
+    // just run with a minimum of fuss.
+    @Test
+    public void testGeneration() throws Exception {
+        JavaScriptContainer container = new JavaScriptContainer(null);
+
+        ToolContext context = new ToolContext();
+        context.put(ToolConstants.CFG_WSDLURL, getLocation("hello_world.wsdl"));
+        container.setContext(context); 
+        container.execute();
+    }
+    
+
+    private String getLocation(String wsdlFile) throws URISyntaxException {
+        return this.getClass().getResource(wsdlFile).toURI().getPath();
+    }
+}

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/hello_world.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/hello_world.wsdl?rev=602118&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/hello_world.wsdl (added)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/hello_world.wsdl Fri Dec  7 07:08:07 2007
@@ -0,0 +1,394 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+		  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+		  xmlns:tns="http://apache.org/hello_world_soap_http"
+		  xmlns:x1="http://apache.org/hello_world_soap_http/types"
+		  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+		  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		  targetNamespace="http://apache.org/hello_world_soap_http" name="HelloWorld">
+    <wsdl:types>
+	<schema targetNamespace="http://apache.org/hello_world_soap_http/types" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:x1="http://apache.org/hello_world_soap_http/types" elementFormDefault="qualified">
+	    <element name="sayHi">
+		<complexType/>
+	    </element>
+	    <element name="sayHiResponse">
+		<complexType>
+		    <sequence>
+			<element name="responseType" type="string"/>
+		    </sequence>
+		</complexType>
+	    </element>
+	    <element name="greetMe">
+		<complexType>
+		    <sequence>
+			<element name="requestType" type="string"/>
+		    </sequence>
+		</complexType>
+	    </element>
+	    <element name="greetMeResponse">
+		<complexType>
+		    <sequence>
+			<element name="responseType" type="string"/>
+		    </sequence>
+		</complexType>
+	    </element>
+
+	    <element name="testNillable">
+		<complexType>
+		    <sequence>
+			<element name="NillElem" nillable="true" type="string"/>
+			<element name="intElem" type="int"/>
+		    </sequence>
+		</complexType>
+	    </element>
+	    <element name="testNillableResponse">
+		<complexType>
+		    <sequence>
+			<element name="responseType" nillable="true" type="string"/>
+		    </sequence>
+		</complexType>
+	    </element>
+
+	    <element name="greetMeLater">
+		<complexType>
+		    <sequence>
+			<element name="requestType" type="long"/>
+		    </sequence>
+		</complexType>
+	    </element>
+	    <element name="greetMeLaterResponse">
+		<complexType>
+		    <sequence>
+			<element name="responseType" type="string"/>
+		    </sequence>
+		</complexType>
+	    </element>
+	    <element name="greetMeSometime">
+		<complexType>
+		    <sequence>
+			<element name="requestType" type="string"/>
+		    </sequence>
+		</complexType>
+	    </element>
+	    <element name="greetMeSometimeResponse">
+		<complexType>
+		    <sequence>
+			<element name="responseType" type="string"/>
+		    </sequence>
+		</complexType>
+	    </element>
+	    <element name="greetMeOneWay">
+		<complexType>
+		    <sequence>
+			<element name="requestType" type="string"/>
+		    </sequence>
+		</complexType>
+	    </element>
+	    <element name="testDocLitFault">
+		<complexType>
+		    <sequence>
+			<element name="faultType" type="string"/>
+		    </sequence>
+		</complexType>
+	    </element>
+	    <element name="testDocLitFaultResponse">
+		<complexType>
+		    <sequence/>
+		</complexType>
+	    </element>
+	    <complexType name="ErrorCode">
+		<sequence>
+		    <element name="minor" type="short"/>
+		    <element name="major" type="short"/>
+		</sequence>
+	    </complexType>
+	    <element name="NoSuchCodeLit">
+		<complexType>
+		    <sequence>
+			<element name="code" type="x1:ErrorCode"/>
+		    </sequence>
+		</complexType>
+	    </element>
+	    <element name="BadRecordLit" type="string"/>
+	    <complexType name="BadRecord">
+		<sequence>
+		    <element name="reason" type="string"/>
+		    <element name="code" type="short"/>
+		</sequence>
+	    </complexType>
+	    <complexType name="addNumbers">
+		<sequence>
+		    <element name="arg0" type="int"/>
+		    <element name="arg1" type="int"/>
+		</sequence>
+	    </complexType>
+	    <element name="addNumbers" type="x1:addNumbers"/>
+	    <complexType name="addNumbersResponse">
+		<sequence>
+		    <element name="return" type="int"/>
+		</sequence>
+	    </complexType>
+	    <element name="addNumbersResponse" type="x1:addNumbersResponse"/>
+	    <complexType name="stringStruct">
+		<sequence>
+		    <element name="arg0" type="string"/>
+		    <element name="arg1" type="string"/>
+		</sequence>
+	    </complexType>
+	    <element name="BareDocument" type="string"/>
+	    <element name="BareDocumentResponse">
+		<complexType>
+		    <sequence>
+			<element name="company" type="string"/>
+		    </sequence>
+		    <attribute name="id" type="int"/>
+		</complexType>
+	    </element>      
+	</schema>
+    </wsdl:types>
+    <wsdl:message name="sayHiRequest">
+	<wsdl:part name="in" element="x1:sayHi"/>
+    </wsdl:message>
+    <wsdl:message name="sayHiResponse">
+	<wsdl:part name="out" element="x1:sayHiResponse"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeRequest">
+	<wsdl:part name="in" element="x1:greetMe"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeResponse">
+	<wsdl:part name="out" element="x1:greetMeResponse"/>
+    </wsdl:message>
+    <wsdl:message name="testNillableRequest">
+	<wsdl:part name="in" element="x1:testNillable"/>
+    </wsdl:message>
+    <wsdl:message name="testNillableResponse">
+	<wsdl:part name="out" element="x1:testNillableResponse"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeLaterRequest">
+	<wsdl:part name="in" element="x1:greetMeLater"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeLaterResponse">
+	<wsdl:part name="out" element="x1:greetMeLaterResponse"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeSometimeRequest">
+	<wsdl:part name="in" element="x1:greetMeSometime"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeSometimeResponse">
+	<wsdl:part name="out" element="x1:greetMeSometimeResponse"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeOneWayRequest">
+	<wsdl:part name="in" element="x1:greetMeOneWay"/>
+    </wsdl:message>
+    <wsdl:message name="testDocLitFaultRequest">
+	<wsdl:part name="in" element="x1:testDocLitFault"/>
+    </wsdl:message>
+    <wsdl:message name="testDocLitFaultResponse">
+	<wsdl:part name="out" element="x1:testDocLitFaultResponse"/>
+    </wsdl:message>
+    <wsdl:message name="NoSuchCodeLitFault">
+	<wsdl:part name="NoSuchCodeLit" element="x1:NoSuchCodeLit"/>
+    </wsdl:message>
+    <wsdl:message name="BadRecordLitFault">
+	<wsdl:part name="BadRecordLit" element="x1:BadRecordLit"/>
+    </wsdl:message>
+    <wsdl:message name="testDocLitBareRequest">
+	<wsdl:part name="in" element="x1:BareDocument"/>
+    </wsdl:message>
+    <wsdl:message name="testDocLitBareResponse">
+	<wsdl:part name="out" element="x1:BareDocumentResponse"/>
+    </wsdl:message> 
+    <wsdl:portType name="Greeter">
+	<wsdl:operation name="sayHi">
+	    <wsdl:input name="sayHiRequest" message="tns:sayHiRequest"/>
+	    <wsdl:output name="sayHiResponse" message="tns:sayHiResponse"/>
+	</wsdl:operation>
+	<wsdl:operation name="greetMe">
+	    <wsdl:input name="greetMeRequest" message="tns:greetMeRequest"/>
+	    <wsdl:output name="greetMeResponse" message="tns:greetMeResponse"/>
+	</wsdl:operation>
+	<wsdl:operation name="testNillable">
+	    <wsdl:input name="testNillableRequest" message="tns:testNillableRequest"/>
+	    <wsdl:output name="testNillableResponse" message="tns:testNillableResponse"/>
+	</wsdl:operation>
+	<wsdl:operation name="greetMeLater">
+	    <wsdl:input name="greetMeLaterRequest" message="tns:greetMeLaterRequest"/>
+	    <wsdl:output name="greetMeLaterResponse" message="tns:greetMeLaterResponse"/>
+	</wsdl:operation>
+	<wsdl:operation name="greetMeSometime">
+	    <wsdl:input name="greetMeSometimeRequest" message="tns:greetMeSometimeRequest"/>
+	    <wsdl:output name="greetMeSometimeResponse" message="tns:greetMeSometimeResponse"/>
+	</wsdl:operation>
+	<wsdl:operation name="greetMeOneWay">
+	    <wsdl:input name="greetMeOneWayRequest" message="tns:greetMeOneWayRequest"/>
+	</wsdl:operation>
+	<wsdl:operation name="testDocLitFault">
+	    <wsdl:input name="testDocLitFaultRequest" message="tns:testDocLitFaultRequest"/>
+	    <wsdl:output name="testDocLitFaultResponse" message="tns:testDocLitFaultResponse"/>
+	    <wsdl:fault name="NoSuchCodeLitFault" message="tns:NoSuchCodeLitFault"/>
+	    <wsdl:fault name="BadRecordLitFault" message="tns:BadRecordLitFault"/>
+	</wsdl:operation>
+
+    </wsdl:portType>
+
+    <wsdl:portType name="DocLitBare">
+	<wsdl:operation name="testDocLitBare">
+	    <wsdl:input name="testDocLitBareRequest" message="tns:testDocLitBareRequest"/>
+	    <wsdl:output name="testDocLitBareResponse" message="tns:testDocLitBareResponse"/>
+	</wsdl:operation>       
+    </wsdl:portType>
+    <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+	<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+	<wsdl:operation name="sayHi">
+	    <soap:operation style="document"/>
+	    <wsdl:input>
+		<soap:body use="literal"/>
+	    </wsdl:input>
+	    <wsdl:output>
+		<soap:body use="literal"/>
+	    </wsdl:output>
+	</wsdl:operation>
+	<wsdl:operation name="greetMe">
+	    <soap:operation style="document"/>
+	    <wsdl:input>
+		<soap:body use="literal"/>
+	    </wsdl:input>
+	    <wsdl:output>
+		<soap:body use="literal"/>
+	    </wsdl:output>
+	</wsdl:operation>
+	<wsdl:operation name="testNillable">
+	    <soap:operation style="document"/>
+	    <wsdl:input>
+		<soap:body use="literal"/>
+	    </wsdl:input>
+	    <wsdl:output>
+		<soap:body use="literal"/>
+	    </wsdl:output>
+	</wsdl:operation>
+	<wsdl:operation name="greetMeLater">
+	    <soap:operation style="document"/>
+	    <wsdl:input>
+		<soap:body use="literal"/>
+	    </wsdl:input>
+	    <wsdl:output>
+		<soap:body use="literal"/>
+	    </wsdl:output>
+	</wsdl:operation>
+	<wsdl:operation name="greetMeSometime">
+	    <soap:operation style="document"/>
+	    <wsdl:input>
+		<soap:body use="literal"/>
+	    </wsdl:input>
+	    <wsdl:output>
+		<soap:body use="literal"/>
+	    </wsdl:output>
+	</wsdl:operation>
+	<wsdl:operation name="greetMeOneWay">
+	    <soap:operation style="document"/>
+	    <wsdl:input>
+		<soap:body use="literal"/>
+	    </wsdl:input>
+	</wsdl:operation>
+	<wsdl:operation name="testDocLitFault">
+	    <soap:operation style="document"/>
+	    <wsdl:input>
+		<soap:body use="literal"/>
+	    </wsdl:input>
+	    <wsdl:output>
+		<soap:body use="literal"/>
+	    </wsdl:output>
+	    <wsdl:fault name="NoSuchCodeLitFault">
+		<soap:fault name="NoSuchCodeLitFault" use="literal"/>
+	    </wsdl:fault>
+	    <wsdl:fault name="BadRecordLitFault">
+		<soap:fault name="BadRecordLitFault" use="literal"/>
+	    </wsdl:fault>
+	</wsdl:operation>
+
+    </wsdl:binding>
+    <wsdl:binding name="Doc_Lit_Bare_SOAPBinding" type="tns:DocLitBare">
+	<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+	<wsdl:operation name="testDocLitBare">
+	    <soap:operation style="document" soapAction="http://apache.org/hello_world_soap_http/testDocLitBare"/>
+	    <wsdl:input name="testDocLitBareRequest">
+		<soap:body use="literal"/>
+	    </wsdl:input>
+	    <wsdl:output name="testDocLitBareResponse">
+		<soap:body use="literal"/>
+	    </wsdl:output>
+	</wsdl:operation>
+    </wsdl:binding>
+
+
+    <wsdl:service name="SOAPService">
+	<wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+	    <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+	</wsdl:port>
+
+	<wsdl:port name="SoapPort1" binding="tns:Greeter_SOAPBinding">
+	    <soap:address location="http://localhost:7000/SoapContext/SoapPort"/>
+	</wsdl:port>
+    </wsdl:service>
+
+    <wsdl:service name="SOAPProviderService">
+	<wsdl:port name="SoapProviderPort" binding="tns:Greeter_SOAPBinding">
+	    <soap:address location="http://localhost:9003/SoapContext/SoapProviderPort"/>
+	</wsdl:port>
+    </wsdl:service>
+
+    <wsdl:service name="SOAPDispatchService">
+	<wsdl:port name="SoapDispatchPort" binding="tns:Greeter_SOAPBinding">
+	    <soap:address location="http://localhost:9006/SOAPDispatchService/SoapDispatchPort"/>
+	</wsdl:port>
+    </wsdl:service>
+
+    <wsdl:service name="SOAPService_DocLitBare">
+	<wsdl:port name="SoapPort2" binding="tns:Doc_Lit_Bare_SOAPBinding">
+	    <soap:address location="http://localhost:7600/SoapContext/SoapPort"/>
+	</wsdl:port>
+    </wsdl:service>
+    <wsdl:service name="SOAPServiceAddressingDocLitBare">
+	<wsdl:port name="SoapPort" binding="tns:Doc_Lit_Bare_SOAPBinding">
+	    <soap:address location="http://localhost:7600/SoapContext/SoapPort"/>
+	    <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
+	</wsdl:port>
+    </wsdl:service>
+    <wsdl:service name="SOAPService_Test1">
+	<wsdl:port name="SoapPort_Test1" binding="tns:Greeter_SOAPBinding">
+	    <soap:address location="http://localhost:9100"/>
+	</wsdl:port>
+	<wsdl:port name="SoapPort_Test2" binding="tns:Greeter_SOAPBinding">
+	    <soap:address location="http://localhost:9101"/>
+	</wsdl:port>
+    </wsdl:service>
+    <wsdl:service name="SOAPServiceAddressing">
+	<wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+	    <soap:address location="http://localhost:9008/SoapContext/SoapPort"/>
+	    <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
+	</wsdl:port>
+    </wsdl:service>
+    <wsdl:service name="SOAPServiceConcurrencyTest">
+	<wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+	    <soap:address location="http://localhost:9009/SoapContext/SoapPort"/>
+	</wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
+

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/hello_world.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/hello_world.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/hello_world.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml