cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1035807 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/ systests/jaxrs/src...
Date Tue, 16 Nov 2010 20:50:57 GMT
Author: dkulp
Date: Tue Nov 16 20:50:56 2010
New Revision: 1035807

URL: http://svn.apache.org/viewvc?rev=1035807&view=rev
Log:
Merged revisions 1035798 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1035798 | dkulp | 2010-11-16 15:43:10 -0500 (Tue, 16 Nov 2010) | 2 lines
  
  [CXF-3128] Properly enforce where exclude=true is allowed rather than
  just ignore it.
........

Added:
    cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/HelloExcludeImpl.java
      - copied unchanged from r1035798, cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/HelloExcludeImpl.java
    cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/HelloExcludeOnInterface.java
      - copied unchanged from r1035798, cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/HelloExcludeOnInterface.java
Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
    cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties
    cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstWSDLTest.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrsJaxws.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Nov 16 20:50:56 2010
@@ -1 +1 @@
-/cxf/trunk:1-1022155,1022157-1023401,1023420-1030540,1030542-1031074,1031076-1033529,1033531,1033533-1033888,1033890-1033925,1033927-1034174,1034637,1035203,1035206,1035220,1035302,1035377,1035391,1035428,1035559,1035614,1035787,1035796
+/cxf/trunk:1-1022155,1022157-1023401,1023420-1030540,1030542-1031074,1031076-1033529,1033531,1033533-1033888,1033890-1033925,1033927-1034174,1034637,1035203,1035206,1035220,1035302,1035377,1035391,1035428,1035559,1035614,1035787,1035796,1035798

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?rev=1035807&r1=1035806&r2=1035807&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
Tue Nov 16 20:50:56 2010
@@ -183,8 +183,26 @@ public class JaxWsServiceConfiguration e
         if (Object.class.equals(method.getDeclaringClass())) {
             return false;
         }
+        
+        if (method.getDeclaringClass() == implInfo.getSEIClass()) {
+            WebMethod wm = method.getAnnotation(WebMethod.class);
+            if (wm != null && wm.exclude()) {
+                Message message = new Message("WEBMETHOD_EXCLUDE_NOT_ALLOWED", LOG,
+                                              method.getName());
+                throw new JaxWsConfigurationException(message);
+            }
+        }
+
+        
         Class implClz = implInfo.getImplementorClass();
-        if (isWebMethod(getDeclaredMethod(implClz, method))) {
+        Method m = getDeclaredMethod(implClz, method);
+        if (m != null) {
+            WebMethod wm = m.getAnnotation(WebMethod.class);
+            if (wm != null && wm.exclude()) {
+                return Boolean.FALSE;
+            }
+        }
+        if (isWebMethod(m)) {
             return true;
         }
         return isWebMethod(getDeclaredMethod(method));

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties?rev=1035807&r1=1035806&r2=1035807&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties
Tue Nov 16 20:50:56 2010
@@ -31,3 +31,4 @@ INVALID_REQUEST_WRAPPER = @RequestWrappe
 INVALID_RESPONSE_WRAPPER = @ResponseWrapper class {0} is the same as the actual return class
{1}.  This is likely not to work. 
 SERVICECLASS_MUST_BE_SET = serviceClass must be set to a valid service interface or class
 XMLSEEALSO_NULL_CLASS = A class listed in the XmlSeeAlso annotation of the service class
%s cannot be found on the classpath. Index: %d of XmlSeeAlso class list.
+WEBMETHOD_EXCLUDE_NOT_ALLOWED = The @javax.jws.WebMethod(exclude=true) cannot be used on
a service endpoint interface. Method: {0}

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstWSDLTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstWSDLTest.java?rev=1035807&r1=1035806&r2=1035807&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstWSDLTest.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstWSDLTest.java
Tue Nov 16 20:50:56 2010
@@ -27,6 +27,7 @@ import org.apache.cxf.Bus;
 import org.apache.cxf.frontend.ServerFactoryBean;
 import org.apache.cxf.jaxws.service.Hello2;
 import org.apache.cxf.jaxws.service.Hello3;
+import org.apache.cxf.jaxws.service.HelloExcludeImpl;
 import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.service.Service;
@@ -114,5 +115,20 @@ public class CodeFirstWSDLTest extends A
         assertNotNull(portType);
         assertEquals(4, portType.getOperations().size());
     }
-
+    @Test
+    public void testExcludeOnInterface() throws Exception {
+        try {
+            JaxWsImplementorInfo info = new JaxWsImplementorInfo(HelloExcludeImpl.class);
+            ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean(info);
+
+            Bus bus = getBus();
+            bean.setBus(bus);
+            
+            bean.create();
+            
+            fail("WebMethod(exclude=true) is not allowed");
+        } catch (JaxWsConfigurationException e) {
+            assertTrue(e.getMessage().contains("WebMethod"));
+        }
+    }
 }

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrsJaxws.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrsJaxws.java?rev=1035807&r1=1035806&r2=1035807&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrsJaxws.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrsJaxws.java
Tue Nov 16 20:50:56 2010
@@ -47,23 +47,19 @@ public interface BookStoreJaxrsJaxws {
     Book addBook(@WebParam(name = "book") Book book);
     
     @Path("/books/{id}")
-    @WebMethod(exclude = true)
     BookSubresource getBookSubresource(@PathParam("id") String id);
     
     @Path("/thestore/{id}")
-    @WebMethod(exclude = true)
     BookStoreJaxrsJaxws getBookStore(@PathParam("id") String id);
     
     @POST
     @Path("/fastinfoset")
     @Consumes({"text/xml" })
     @Produces({"application/fastinfoset", "text/xml", "application/xml" })
-    @WebMethod(exclude = true)
     Book addFastinfoBook(Book book);
     
     @GET
     @Path("/fastinfoset2")
     @Produces({"application/fastinfoset", "text/xml", "application/xml" })
-    @WebMethod(exclude = true)
     Book getFastinfoBook();
 }



Mime
View raw message