You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2008/08/26 17:43:22 UTC

svn commit: r689114 - in /cxf/branches/2.0.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/ tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/front...

Author: dkulp
Date: Tue Aug 26 08:43:21 2008
New Revision: 689114

URL: http://svn.apache.org/viewvc?rev=689114&view=rev
Log:
Merged revisions 687465 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.1.x-fixes

................
  r687465 | dkulp | 2008-08-20 17:05:21 -0400 (Wed, 20 Aug 2008) | 10 lines
  
  Merged revisions 687463 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r687463 | dkulp | 2008-08-20 17:00:53 -0400 (Wed, 20 Aug 2008) | 3 lines
    
    Update to try and eliminate a NPE with service creation
    [CXF-1756] Remove name attribute from generated impls
  ........
................

Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
    cxf/branches/2.0.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
    cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm
    cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
    cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 26 08:43:21 2008
@@ -1,3 +1,3 @@
-/cxf/branches/2.1.x-fixes:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237,686283,686299,686333-686364,686765,686827,687097,687464
-/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387
+/cxf/branches/2.1.x-fixes:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237,686283,686299,686333-686364,686765,686827,687097,687464-687465
+/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463
 /incubator/cxf/trunk:434594-651668

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Aug 26 08:43:21 2008
@@ -1 +1 @@
-/cxf/branches/2.1.x-fixes:1-686313,686315-686332,686334-686346,686348-686828,687097,687464
+/cxf/branches/2.1.x-fixes:1-686313,686315-686332,686334-686346,686348-686828,687097,687464-687465

Modified: cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?rev=689114&r1=689113&r2=689114&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java (original)
+++ cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java Tue Aug 26 08:43:21 2008
@@ -53,7 +53,6 @@
 import org.apache.cxf.service.model.InterfaceInfo;
 import org.apache.cxf.service.model.MessageInfo;
 import org.apache.cxf.service.model.OperationInfo;
-import org.apache.cxf.tools.util.AnnotationUtil;
 
 public class JaxWsServiceConfiguration extends AbstractServiceConfiguration {
 
@@ -142,33 +141,40 @@
         }
     }
 
-    @Override
-    public Boolean isOperation(Method method) {
-        Method origMethod = method;
-        method = getDeclaredMethod(method);
+    public Boolean isWebMethod(final Method method) {
         if (method == null
             || method.getReturnType().equals(Future.class)
             || method.getReturnType().equals(Response.class)) {
-            return false;
+            return Boolean.FALSE;
         }
         
-        if (method != null) {
-            WebMethod wm = method.getAnnotation(WebMethod.class);
-            if (wm != null) {
-                if (wm.exclude()) {
-                    return Boolean.FALSE;
-                } else {
-                    return Boolean.TRUE;
-                }
+        WebMethod wm = method.getAnnotation(WebMethod.class);
+        if (wm != null) {
+            if (wm.exclude()) {
+                return Boolean.FALSE;
             } else {
-                if (method.getDeclaringClass().isInterface()) {
-                    return hasWebServiceAnnotation(method) 
-                        ||  hasWebServiceAnnotation(origMethod);
-                }
-                return hasWebServiceAnnotation(method);              
+                return Boolean.TRUE;
             }
+        } 
+        if (method.getDeclaringClass().isInterface()) {
+            return hasWebServiceAnnotation(method);
+        }
+        if (implInfo.getSEIClass() == null) {
+            return hasWebServiceAnnotation(method);
         }
-        return Boolean.FALSE;
+        return implInfo.getSEIClass().isAssignableFrom(method.getDeclaringClass());
+    }
+
+    @Override
+    public Boolean isOperation(final Method method) {
+        if (Object.class.equals(method.getDeclaringClass())) {
+            return false;
+        }
+        Class implClz = implInfo.getImplementorClass();
+        if (isWebMethod(getDeclaredMethod(implClz, method))) {
+            return true;
+        }
+        return isWebMethod(getDeclaredMethod(method));
     }
     
     private boolean hasWebServiceAnnotation(Method method) {
@@ -176,15 +182,17 @@
     }
 
     Method getDeclaredMethod(Method method) {
-        Class<?> endpointClass = implInfo.getEndpointClass();
+        return getDeclaredMethod(implInfo.getEndpointClass(), method);
+    }
 
+    private Method getDeclaredMethod(Class<?> endpointClass, Method method) {
         if (!method.getDeclaringClass().equals(endpointClass)) {
             try {
                 method = endpointClass.getMethod(method.getName(), (Class[])method.getParameterTypes());
             } catch (SecurityException e) {
                 throw new ServiceConstructionException(e);
             } catch (NoSuchMethodException e) {
-                return null;
+                return isWebMethod(method) ? method : null;
             }
         }
         return method;
@@ -528,7 +536,7 @@
         ResponseWrapper rw = m.getAnnotation(ResponseWrapper.class);
         String clsName = "";
         if (rw == null) {
-            clsName = getPackageName(selected) + ".jaxws." + AnnotationUtil.capitalize(selected.getName())
+            clsName = getPackageName(selected) + ".jaxws." + StringUtils.capitalize(selected.getName())
                       + "Response";
         } else {
             clsName = rw.className();
@@ -593,7 +601,7 @@
         RequestWrapper rw = m.getAnnotation(RequestWrapper.class);
         String clsName = "";
         if (rw == null) {
-            clsName = getPackageName(selected) + ".jaxws." + AnnotationUtil.capitalize(selected.getName());
+            clsName = getPackageName(selected) + ".jaxws." + StringUtils.capitalize(selected.getName());
         } else {
             clsName = rw.className();
         }

Modified: cxf/branches/2.0.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java?rev=689114&r1=689113&r2=689114&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java (original)
+++ cxf/branches/2.0.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java Tue Aug 26 08:43:21 2008
@@ -266,7 +266,7 @@
         File wsdlFile = outputFile("tmp.wsdl");
         String[] args = new String[] {"-wsdl", "-o", output.getPath() + "/tmp.wsdl", "-verbose", "-s",
                                       output.getPath(), "-frontend", "jaxws", "-client", "-server",
-                                      "org.apache.cxf.tools.fortest.GreeterImpl"};
+                                      org.apache.cxf.tools.fortest.GreeterImpl.class.getName()};
         JavaToWS.main(args);
         assertTrue("Failed to generate WSDL file", wsdlFile.exists());
 

Modified: cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm?rev=689114&r1=689113&r2=689114&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm (original)
+++ cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm Tue Aug 26 08:43:21 2008
@@ -34,7 +34,7 @@
  * 
  */
 
-@javax.jws.WebService(name = "$intf.Name",
+@javax.jws.WebService(
 #if ($service.ServiceName != "") 
                       serviceName = "$service.ServiceName",
 #end

Modified: cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java?rev=689114&r1=689113&r2=689114&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java (original)
+++ cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java Tue Aug 26 08:43:21 2008
@@ -90,7 +90,8 @@
 
         Class clz = classLoader.loadClass("org.apache.cxf.cxf1678.hello_world_soap_http.GreeterImpl");
         WebService webServiceAnn = AnnotationUtil.getPrivClassAnnotation(clz, WebService.class);
-        assertEquals("Greeter", webServiceAnn.name());
+        assertEquals("org.apache.cxf.cxf1678.hello_world_soap_http.Greeter",
+                     webServiceAnn.endpointInterface());
     }
 
     @Test
@@ -115,7 +116,8 @@
         Class clz = classLoader.loadClass("org.apache.hello_world_soap_http.GreeterImpl");
 
         WebService webServiceAnn = AnnotationUtil.getPrivClassAnnotation(clz, WebService.class);
-        assertEquals("Greeter", webServiceAnn.name());
+        assertTrue("Impl class should note generate name property value in webService annotation",
+                    webServiceAnn.name().equals(""));
         assertFalse("Impl class should generate portName property value in webService annotation",
                     webServiceAnn.portName().equals(""));
         assertFalse("Impl class should generate serviceName property value in webService annotation",

Modified: cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java?rev=689114&r1=689113&r2=689114&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java (original)
+++ cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java Tue Aug 26 08:43:21 2008
@@ -307,7 +307,6 @@
         assertTrue("Webservice annotation wsdlLocation should begin with file", ws.wsdlLocation()
             .startsWith("file"));
         assertEquals("org.apache.hello_world_rpclit.GreeterRPCLit", ws.endpointInterface());
-        assertEquals("GreeterRPCLit", ws.name());
 
     }