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 1BD0C95EB for ; Fri, 16 Mar 2012 17:30:54 +0000 (UTC) Received: (qmail 89148 invoked by uid 500); 16 Mar 2012 17:30:53 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 89103 invoked by uid 500); 16 Mar 2012 17:30:53 -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 89095 invoked by uid 99); 16 Mar 2012 17:30:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Mar 2012 17:30:53 +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; Fri, 16 Mar 2012 17:30:52 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 643BC238890B; Fri, 16 Mar 2012 17:30:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1301659 - in /cxf/branches/2.4.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java systests/jaxws/src/test/java/org/apache/cxf/systest/provider/InterpretNullAsOnewayProviderTest.java Date: Fri, 16 Mar 2012 17:30:32 -0000 To: commits@cxf.apache.org From: ay@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120316173032.643BC238890B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ay Date: Fri Mar 16 17:30:31 2012 New Revision: 1301659 URL: http://svn.apache.org/viewvc?rev=1301659&view=rev Log: Merged revisions 1301636 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes ................ r1301636 | ay | 2012-03-16 17:29:14 +0100 (Fri, 16 Mar 2012) | 9 lines Merged revisions 1301597 https://svn.apache.org/repos/asf/cxf/trunk ........ r1301597 | ay | 2012-03-16 15:31:24 +0100 (Fri, 16 Mar 2012) | 1 line [CXF-4182] make jaxws.provider.interpretNullAsOneway prop configurable using a string ........ ................ Modified: cxf/branches/2.4.x-fixes/ (props changed) cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java cxf/branches/2.4.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/InterpretNullAsOnewayProviderTest.java Propchange: cxf/branches/2.4.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Mar 16 17:30:31 2012 @@ -1,2 +1,2 @@ -/cxf/branches/2.5.x-fixes:1299092,1299637,1299725,1300270,1300343,1300407-1300533,1300536,1300560,1301205 +/cxf/branches/2.5.x-fixes:1299092,1299637,1299725,1300270,1300343,1300407-1300533,1300536,1300560,1301205,1301636 /cxf/trunk:1298470,1298830,1298832,1299086,1299635,1299682,1299747,1300342,1300518,1300530,1300555,1301201 Propchange: cxf/branches/2.4.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java?rev=1301659&r1=1301658&r2=1301659&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java (original) +++ cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java Fri Mar 16 17:30:31 2012 @@ -32,6 +32,7 @@ import org.apache.cxf.interceptor.Fault; import org.apache.cxf.jaxws.context.WebServiceContextImpl; import org.apache.cxf.jaxws.context.WrappedMessageContext; import org.apache.cxf.message.Exchange; +import org.apache.cxf.message.MessageUtils; import org.apache.cxf.service.invoker.Factory; import org.apache.cxf.service.invoker.SingletonFactory; @@ -60,7 +61,7 @@ public class JAXWSMethodInvoker extends } res = CastUtils.cast((List)super.invoke(exchange, serviceObject, m, params)); if ((serviceObject instanceof Provider) - && Boolean.TRUE.equals(exchange.getInMessage(). + && MessageUtils.isTrue(exchange.getInMessage(). getContextualProperty("jaxws.provider.interpretNullAsOneway")) && (res != null && !res.isEmpty() && res.get(0) == null)) { // treat the non-oneway call as oneway when a provider returns null Modified: cxf/branches/2.4.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/InterpretNullAsOnewayProviderTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/InterpretNullAsOnewayProviderTest.java?rev=1301659&r1=1301658&r2=1301659&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/InterpretNullAsOnewayProviderTest.java (original) +++ cxf/branches/2.4.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/InterpretNullAsOnewayProviderTest.java Fri Mar 16 17:30:31 2012 @@ -43,6 +43,7 @@ public class InterpretNullAsOnewayProvid private static final String ADDRESS1 = "http://localhost:" + PORT + "/test/nullable1"; private static final String ADDRESS2 = "http://localhost:" + PORT + "/test/nullable2"; + private static final String ADDRESS3 = "http://localhost:" + PORT + "/test/nullable3"; public static class Server extends AbstractBusTestServerBase { @@ -57,6 +58,12 @@ public class InterpretNullAsOnewayProvid Endpoint ep2 = Endpoint.publish(ADDRESS2, servant2); assertNotNull("endpoint published", ep2); ep2.getProperties().put("jaxws.provider.interpretNullAsOneway", Boolean.TRUE); + + // endpoint interpreting null as oneway + NullProviderService servant3 = new NullProviderService(); + Endpoint ep3 = Endpoint.publish(ADDRESS3, servant3); + assertNotNull("endpoint published", ep3); + ep3.getProperties().put("jaxws.provider.interpretNullAsOneway", "true"); } public static void main(String[] args) throws Exception { @@ -97,6 +104,12 @@ public class InterpretNullAsOnewayProvid HttpURLConnection conn = postRequest(ADDRESS2); assertEquals("http 202 must be returned", 202, conn.getResponseCode()); } + + @Test + public void testInterpretNullAsOneway2() throws Exception { + HttpURLConnection conn = postRequest(ADDRESS3); + assertEquals("http 202 must be returned", 202, conn.getResponseCode()); + } private static HttpURLConnection postRequest(String address) throws Exception { URL url = new URL(address);