Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B5DAD8155 for ; Tue, 30 Aug 2011 20:56:59 +0000 (UTC) Received: (qmail 88872 invoked by uid 500); 30 Aug 2011 20:56:59 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 88757 invoked by uid 500); 30 Aug 2011 20:56:58 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 88750 invoked by uid 99); 30 Aug 2011 20:56:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Aug 2011 20:56:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Aug 2011 20:56:56 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 54F592388A19 for ; Tue, 30 Aug 2011 20:56:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1163374 - in /cxf/trunk/rt: core/src/main/java/org/apache/cxf/bus/ frontend/simple/src/main/java/org/apache/cxf/service/factory/ frontend/simple/src/test/java/org/apache/cxf/service/factory/ Date: Tue, 30 Aug 2011 20:56:36 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110830205636.54F592388A19@eris.apache.org> Author: dkulp Date: Tue Aug 30 20:56:35 2011 New Revision: 1163374 URL: http://svn.apache.org/viewvc?rev=1163374&view=rev Log: [CXF-3593] Provide a config setting to require a wsdl Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java?rev=1163374&r1=1163373&r2=1163374&view=diff ============================================================================== --- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java (original) +++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java Tue Aug 30 20:56:35 2011 @@ -244,6 +244,10 @@ public class CXFBusImpl extends Abstract } public void setProperty(String s, Object o) { - properties.put(s, o); + if (o == null) { + properties.remove(s); + } else { + properties.put(s, o); + } } } Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=1163374&r1=1163373&r2=1163374&view=diff ============================================================================== --- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original) +++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Tue Aug 30 20:56:35 2011 @@ -401,6 +401,12 @@ public class ReflectionServiceFactoryBea } protected void buildServiceFromClass() { + Object o = getBus().getProperty("requireExplicitContractLocation"); + if (o != null + && ("true".equals(o) || Boolean.TRUE.equals(o))) { + throw new ServiceConstructionException(new Message("NO_WSDL_PROVIDED", LOG, + getServiceClass().getName())); + } if (LOG.isLoggable(Level.INFO)) { LOG.info("Creating Service " + getServiceQName() + " from class " + getServiceClass().getName()); } Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties?rev=1163374&r1=1163373&r2=1163374&view=diff ============================================================================== --- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties (original) +++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties Tue Aug 30 20:56:35 2011 @@ -33,4 +33,4 @@ INTRACTABLE_PART= Message part {0} of Me JAXWS_ANNOTATION_FOUND=A JAX-WS Annotation was found on {0} while using the Simple frontend. For better results, use the JAX-WS frontend. XSD_VALIDATION_ERROR= Error in W3C XML Schema associated with service: {0} COULD_NOT_UNWRAP=Could not unwrap Operation {0} to match method "{1}" - +NO_WSDL_PROVIDED=WSDL is required for services created from class {0}, but no WSDL location specified. Modified: cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java?rev=1163374&r1=1163373&r2=1163374&view=diff ============================================================================== --- cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java (original) +++ cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java Tue Aug 30 20:56:35 2011 @@ -132,7 +132,19 @@ public class ReflectionServiceFactoryTes return serviceFactory.create(); } - + @Test + public void testWSDLRequired() throws Exception { + + getBus().setProperty("requireExplicitContractLocation", Boolean.TRUE); + try { + createService(true); + fail("Should have failed"); + } catch (ServiceConstructionException ex) { + getBus().setProperty("requireExplicitContractLocation", null); + } + + + } @Test public void testServerFactoryBean() throws Exception { Service service = createService(true);