cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1127273 - in /cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template: build.vm client.vm service.vm
Date Tue, 24 May 2011 20:35:16 GMT
Author: dkulp
Date: Tue May 24 20:35:15 2011
New Revision: 1127273

URL: http://svn.apache.org/viewvc?rev=1127273&view=rev
Log:
[CXF-3517] If wsdlLocation is a classpath: location, attempt to do
something semi-smart in the generated code to find it.

Modified:
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/build.vm
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/build.vm
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/build.vm?rev=1127273&r1=1127272&r2=1127273&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/build.vm
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/build.vm
Tue May 24 20:35:15 2011
@@ -112,16 +112,22 @@
     <target name="$targetName" description="Run $clientClassNamesMap.get($targetName)"
depends="compile">
         <property name="param" value=""/>
         <cxfrun classname="$clientClassNamesMap.get($targetName)"
-                   param1="$wsdlLocation"
-                   param2="${op}"
-                   param3="${param}"/>
+#if ($wsdlLocation.startsWith("classpath:"))
+                   />    
+#else
+                   param1="$wsdlLocation"/>
+#end
     </target>
 #end
 
 #foreach ($target in $serverClassNamesMap.keySet())
     <target name="${target}" description="Run $serverClassNamesMap.get($target)" depends="compile">
         <cxfrun classname="$serverClassNamesMap.get($target)"
+#if ($wsdlLocation.startsWith("classpath:"))
+                   />    
+#else
                    param1="$wsdlLocation"/>
+#end
     </target>
 #end
 

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm?rev=1127273&r1=1127272&r2=1127273&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm
Tue May 24 20:35:15 2011
@@ -63,7 +63,7 @@ public final class ${clientClassName} {
 #end
     public static void main(String args[]) throws java.lang.Exception {
         URL wsdlURL = ${service.Name}.WSDL_LOCATION;
-        if (args.length > 0) { 
+        if (args.length > 0 && args[0] != null && !"".equals(args[0]))
{ 
             File wsdlFile = new File(args[0]);
             try {
                 if (wsdlFile.exists()) {

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm?rev=1127273&r1=1127272&r2=1127273&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
Tue May 24 20:35:15 2011
@@ -80,6 +80,19 @@ public class ${service.Name} extends ${s
         WSDL_LOCATION = null;
 #elseif ($wsdlLocation == "null")       
         WSDL_LOCATION = null;
+#elseif ($wsdlLocation.startsWith("classpath:"))
+        URL url = ${service.Name}.class.getClassLoader().getResource("$wsdlLocation.substring(10)");
+#if ($wsdlLocation.startsWith("classpath:/"))
+        if (url == null) {
+            url = ${service.Name}.class.getClassLoader().getResource("$wsdlLocation.substring(11)");
+        }
+#end        
+        if (url == null) {
+            java.util.logging.Logger.getLogger(${service.Name}.class.getName())
+                .log(java.util.logging.Level.INFO, 
+                     "Can not initialize the default wsdl from {0}", "$wsdlLocation");
+        }       
+        WSDL_LOCATION = url;
 #else
         URL url = null;
         try {



Mime
View raw message