Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 59455 invoked from network); 25 May 2010 07:16:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 May 2010 07:16:18 -0000 Received: (qmail 4616 invoked by uid 500); 25 May 2010 07:16:18 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 4507 invoked by uid 500); 25 May 2010 07:16:17 -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 4500 invoked by uid 99); 25 May 2010 07:16:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 May 2010 07:16:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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, 25 May 2010 07:16:13 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4247E2388978; Tue, 25 May 2010 07:15:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r947948 - in /cxf/trunk/rt/frontend/jaxws/src: main/java/org/apache/cxf/jaxws/ServiceImpl.java test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java test/java/org/apache/cxf/jaxws/dispatch/bus-dispatch.xml Date: Tue, 25 May 2010 07:15:52 -0000 To: commits@cxf.apache.org From: ema@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100525071552.4247E2388978@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ema Date: Tue May 25 07:15:51 2010 New Revision: 947948 URL: http://svn.apache.org/viewvc?rev=947948&view=rev Log: [CXF-2822]:Added the interceptors in ClientFactoryBean to ClientIml. This made configuration work for dispatch client Added: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/bus-dispatch.xml Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?rev=947948&r1=947947&r2=947948&view=diff ============================================================================== --- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java (original) +++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java Tue May 25 07:15:51 2010 @@ -621,7 +621,8 @@ public class ServiceImpl extends Service for (AbstractFeature af : endpoint.getFeatures()) { af.initialize(client, bus); } - + //CXF-2822 + initIntercepors(client, clientFac); if (executor != null) { client.getEndpoint().setExecutor(executor); } @@ -669,6 +670,8 @@ public class ServiceImpl extends Service for (AbstractFeature af : clientFac.getFeatures()) { af.initialize(client, bus); } + //CXF-2822 + initIntercepors(client, clientFac); if (executor != null) { client.getEndpoint().setExecutor(executor); } @@ -696,4 +699,11 @@ public class ServiceImpl extends Service features); } + + private void initIntercepors(Client client, JaxWsClientFactoryBean clientFact) { + client.getInInterceptors().addAll(clientFact.getInInterceptors()); + client.getOutInterceptors().addAll(clientFact.getOutInterceptors()); + client.getInFaultInterceptors().addAll(clientFact.getInFaultInterceptors()); + client.getOutFaultInterceptors().addAll(clientFact.getOutFaultInterceptors()); + } } Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java?rev=947948&r1=947947&r2=947948&view=diff ============================================================================== --- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java (original) +++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java Tue May 25 07:15:51 2010 @@ -19,6 +19,7 @@ package org.apache.cxf.jaxws.dispatch; import java.net.URL; +import java.util.List; import javax.xml.bind.JAXBContext; import javax.xml.namespace.QName; @@ -32,10 +33,16 @@ import javax.xml.ws.soap.SOAPFaultExcept import org.w3c.dom.Document; +import org.apache.cxf.Bus; +import org.apache.cxf.bus.spring.SpringBusFactory; import org.apache.cxf.helpers.DOMUtils; +import org.apache.cxf.interceptor.Interceptor; +import org.apache.cxf.interceptor.LoggingInInterceptor; import org.apache.cxf.jaxws.AbstractJaxWsTest; +import org.apache.cxf.jaxws.DispatchImpl; import org.apache.cxf.jaxws.MessageReplayObserver; import org.apache.cxf.jaxws.ServiceImpl; +import org.apache.cxf.message.Message; import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.transport.Destination; import org.apache.hello_world_soap_http.SOAPService; @@ -136,4 +143,25 @@ public class DispatchTest extends Abstra fail("SOAPFaultException was not thrown"); } + + @Test + // CXF-2822 + public void testInterceptorsConfiguration() throws Exception { + String cfgFile = "org/apache/cxf/jaxws/dispatch/bus-dispatch.xml"; + Bus bus = new SpringBusFactory().createBus(cfgFile, true); + ServiceImpl service = new ServiceImpl(bus, getClass().getResource("/wsdl/hello_world.wsdl"), + serviceName, null); + + Dispatch disp = service.createDispatch(portName, Source.class, Service.Mode.MESSAGE); + List> interceptors = ((DispatchImpl)disp).getClient() + .getInInterceptors(); + boolean exists = false; + for (Interceptor interceptor : interceptors) { + if (interceptor instanceof LoggingInInterceptor) { + exists = true; + } + } + assertTrue("The LoggingInInterceptor is not configured to dispatch client", exists); + } + } Added: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/bus-dispatch.xml URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/bus-dispatch.xml?rev=947948&view=auto ============================================================================== --- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/bus-dispatch.xml (added) +++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/bus-dispatch.xml Tue May 25 07:15:51 2010 @@ -0,0 +1,38 @@ + + + + + + + + + + +