cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r662308 - in /cxf/trunk: rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/ tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/ tools/wsdlto/frontend/javascript/src/main/resources/org/ tools/wsdlto/fro...
Date Mon, 02 Jun 2008 02:22:15 GMT
Author: bimargulies
Date: Sun Jun  1 19:22:15 2008
New Revision: 662308

URL: http://svn.apache.org/viewvc?rev=662308&view=rev
Log:
Fix two issues with wsdl2js. Fix -p, remove -client.

Added:
    cxf/trunk/tools/wsdlto/frontend/javascript/src/main/resources/org/
    cxf/trunk/tools/wsdlto/frontend/javascript/src/main/resources/org/apache/
    cxf/trunk/tools/wsdlto/frontend/javascript/src/main/resources/org/apache/cxf/
    cxf/trunk/tools/wsdlto/frontend/javascript/src/main/resources/org/apache/cxf/tools/
    cxf/trunk/tools/wsdlto/frontend/javascript/src/main/resources/org/apache/cxf/tools/wsdlto/
    cxf/trunk/tools/wsdlto/frontend/javascript/src/main/resources/org/apache/cxf/tools/wsdlto/javascript/
    cxf/trunk/tools/wsdlto/frontend/javascript/src/main/resources/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml
      - copied, changed from r662305, cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml
Removed:
    cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml
Modified:
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
    cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java
    cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptProcessor.java
    cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java

Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java?rev=662308&r1=662307&r2=662308&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
(original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
Sun Jun  1 19:22:15 2008
@@ -82,7 +82,7 @@
             }
             if (inf != null
                 && inf.getMessagePart(0).getTypeClass() != null) {
-                //if the wrapper has a type class, we don't need t do anything
+                //if the wrapper has a type class, we don't need to do anything
                 //as everything would have been discovered when walking the
                 //wrapper type (unless it's a header which wouldn't be in the wrapper)
                 return;

Modified: cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java?rev=662308&r1=662307&r2=662308&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java
Sun Jun  1 19:22:15 2008
@@ -83,7 +83,7 @@
     public void execute() throws ToolException {
         buildToolContext();
         validate(context);
-
+        
         WSDLConstants.WSDLVersion version = getWSDLVersion();
 
         String wsdlURL = (String)context.get(ToolConstants.CFG_WSDLURL);

Modified: cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptProcessor.java?rev=662308&r1=662307&r2=662308&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptProcessor.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptProcessor.java
Sun Jun  1 19:22:15 2008
@@ -28,8 +28,10 @@
 import java.io.OutputStreamWriter;
 import java.nio.charset.Charset;
 import java.util.Collection;
+import java.util.Map;
 
 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;
@@ -48,12 +50,23 @@
         super.process();
 
         ServiceInfo serviceInfo = context.get(ServiceInfo.class);
-
         File jsFile = getOutputFile(serviceInfo.getName().getLocalPart() + ".js");
 
         BasicNameManager nameManager = BasicNameManager.newNameManager(serviceInfo, null);
         NamespacePrefixAccumulator prefixManager = new NamespacePrefixAccumulator(serviceInfo
-            .getXmlSchemaCollection());
+                                                                                  .getXmlSchemaCollection());
+        
+        Map<String, String> nsPrefixMap = 
+            CastUtils.cast(
+                           context.get(ToolConstants.CFG_JSPREFIXMAP, Map.class),
+                           String.class, String.class);
+
+        if (nsPrefixMap != null) {
+            for (Map.Entry<String, String> prefixEntry : nsPrefixMap.entrySet()) {
+                prefixManager.collect(prefixEntry.getValue(), prefixEntry.getKey());
+            }
+        }
+        
         Collection<SchemaInfo> schemata = serviceInfo.getSchemas();
         try {
             FileOutputStream fileOutputStream = new FileOutputStream(jsFile);

Copied: cxf/trunk/tools/wsdlto/frontend/javascript/src/main/resources/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml
(from r662305, cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml)
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/javascript/src/main/resources/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml?p2=cxf/trunk/tools/wsdlto/frontend/javascript/src/main/resources/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml&p1=cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml&r1=662305&r2=662308&rev=662308&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml
(original)
+++ cxf/trunk/tools/wsdlto/frontend/javascript/src/main/resources/org/apache/cxf/tools/wsdlto/javascript/javascript-toolspec.xml
Sun Jun  1 19:22:15 2008
@@ -25,7 +25,7 @@
 
     <annotation>
 Examples:
-        wsdl2java -client HelloWorld.wsdl
+        wsdl2js HelloWorld.wsdl
     </annotation>
 
     <usage>
@@ -72,12 +72,6 @@
                 </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 

Modified: cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java?rev=662308&r1=662307&r2=662308&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java
Sun Jun  1 19:22:15 2008
@@ -19,6 +19,10 @@
 
 package org.apache.cxf.tools.wsdlto.javascript;
 
+import java.io.File;
+import java.io.FileInputStream;
+
+import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.tools.common.ProcessorTestBase;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
@@ -37,7 +41,16 @@
         ToolContext context = new ToolContext();
         context.put(ToolConstants.CFG_WSDLURL, getLocation("hello_world.wsdl"));
         context.put(ToolConstants.CFG_OUTPUTDIR, output.toString()); 
+        String[] prefixes = new String[1];
+        prefixes[0] = "http://apache.org/hello_world_soap_http=murble";
+        context.put(ToolConstants.CFG_JSPACKAGEPREFIX, prefixes);
         container.setContext(context); 
         container.execute();
+        // now we really want to check some results.
+        File resultFile = new File(output, "SOAPService_Test1.js");
+        assertTrue(resultFile.canRead());
+        FileInputStream fis = new FileInputStream(resultFile);
+        String javascript = IOUtils.readStringFromStream(fis);
+        assertTrue(javascript.contains("xmlns:murble='http://apache.org/hello_world_soap_http'"));
     }
 }



Mime
View raw message