Index: modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/CustomBusServletTestCase.java
===================================================================
--- modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/CustomBusServletTestCase.java	(revision 0)
+++ modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/CustomBusServletTestCase.java	(working copy)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.in_container_client;
+import static org.jboss.wsf.stack.cxf.client.Constants.JBWS_CXF_JAXWS_CLIENT_BUS_SELECTOR;
+
+import java.io.File;
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+
+import junit.framework.Test;
+
+import org.jboss.ws.common.IOUtils;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+
+/**
+ * A testcase for verifying a cxf.xml Spring descriptor based Bus can
+ * successfully be created and used in a in-container client.
+ * 
+ * @author alessio.soldano@jboss.com
+ * @since 08-May-2013
+ *
+ */
+public class CustomBusServletTestCase extends JBossWSTest
+{
+   public static BaseDeployment<?>[] createDeployments() {
+       
+      List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
+      list.add(new JBossWSTestHelper.WarDeployment("jaxws-cxf-in_container_client-client_spring.war") { {
+         archive
+               .addManifest()
+               .addAsResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/in_container_client/cxf.xml"), "cxf.xml")
+               .addAsResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/in_container_client/cxf-client.xml"), "cxf-client.xml")
+               .addClass(org.jboss.test.ws.jaxws.cxf.in_container_client.HelloWorld.class)
+               .addClass(org.jboss.test.ws.jaxws.cxf.in_container_client.Helper.class)
+               .addClass(org.jboss.wsf.test.ClientHelper.class)
+               .addClass(org.jboss.wsf.test.TestServlet.class)
+               .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/in_container_client/WEB-INF/jboss-deployment-structure.xml"), "jboss-deployment-structure.xml");
+         }
+      });
+      list.add(new JBossWSTestHelper.WarDeployment("jaxws-cxf-in_container_client_spring.war") { {
+         archive
+               .addManifest()
+               .addClass(org.jboss.test.ws.jaxws.cxf.in_container_client.HelloWorld.class)
+               .addClass(org.jboss.test.ws.jaxws.cxf.in_container_client.HelloWorldImpl.class);
+         }
+      });
+      return list.toArray(new BaseDeployment<?>[list.size()]);
+   }
+
+   public static Test suite()
+   {
+      return new JBossWSCXFTestSetup(CustomBusServletTestCase.class, JBossWSTestHelper.writeToFile(createDeployments())) {
+          /// see https://issues.jboss.org/browse/JBWS-3832
+          private static final String PROPERTY_NAME = JBWS_CXF_JAXWS_CLIENT_BUS_SELECTOR;
+          private static final String SPRING_BUS_SELECTOR = "org.jboss.wsf.stack.cxf.client.SpringCustomClientBusSelector";
+          private static final String DEFAULT_BUS_SELECTOR = "org.jboss.wsf.stack.cxf.client.ClientBusSelector";
+
+          private String formerValue;
+
+          @Override
+          public void setUp() throws Exception {
+              formerValue = JBossWSTestHelper.setSystemProperty(PROPERTY_NAME, SPRING_BUS_SELECTOR);
+              super.setUp();
+          }
+
+          @Override
+          public void tearDown() throws Exception {
+              super.tearDown();
+              JBossWSTestHelper.setSystemProperty(PROPERTY_NAME, formerValue);
+              formerValue = null;
+          }
+      };
+   }
+   
+   public void test() throws Exception
+   {
+      assertEquals("1", runTestInContainer("testSpringBus"));
+   }
+   
+   private String runTestInContainer(String test) throws Exception
+   {
+      URL url = new URL("http://" + getServerHost()
+            + ":8080/jaxws-cxf-in_container_client-client_spring?path=/jaxws-cxf-in_container_client_spring/HelloWorldService&method=" + test
+            + "&helper=" + Helper.class.getName());
+      return IOUtils.readAndCloseStream(url.openStream());
+   }
+}
Index: modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/Helper.java
===================================================================
--- modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/Helper.java	(revision 18954)
+++ modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/Helper.java	(working copy)
@@ -30,6 +30,7 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.jboss.logging.Logger;
+import org.jboss.wsf.stack.cxf.client.ClientBusSelector;
 import org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory;
 import org.jboss.wsf.test.ClientHelper;
 
@@ -56,6 +57,8 @@
          return false;
       }
       Bus bus = ((JBossWSBusFactory)factory).createBus("cxf.xml"); //force Spring bus construction
+      assert bus.getOutInterceptors().isEmpty() == true; // cxf-client.xml bus has at least one outinterceptor
+
       try
       {
          BusFactory.setThreadDefaultBus(bus);
@@ -70,6 +73,29 @@
       
    }
    
+   public boolean testSpringBus() throws Exception
+   {
+      BusFactory factory = BusFactory.newInstance();
+      if (!(factory instanceof JBossWSBusFactory)) { //check jbossws-cxf integration is on
+         log.error("Expected instance of " + JBossWSBusFactory.class + " but got: " + factory.getClass());
+         return false;
+      }
+      Bus bus = ClientBusSelector.getInstance().createNewBus(); //force Spring bus construction
+      assert bus.getOutInterceptors().isEmpty() == false; // cxf-client.xml bus has at least one outinterceptor
+      try
+      {
+         BusFactory.setThreadDefaultBus(bus);
+         
+         HelloWorld port = getPort();
+         return ("foo".equals(port.echo("foo")));
+      }
+      finally
+      {
+         bus.shutdown(true);
+      }
+      
+   }
+   
    private HelloWorld getPort() throws MalformedURLException
    {
       URL wsdlURL = new URL(targetEndpointURL + "?wsdl");
Index: modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/ServletTestCase.java
===================================================================
--- modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/ServletTestCase.java	(revision 18954)
+++ modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/ServletTestCase.java	(working copy)
@@ -21,6 +21,8 @@
  */
 package org.jboss.test.ws.jaxws.cxf.in_container_client;
 
+import static org.jboss.wsf.stack.cxf.client.Constants.JBWS_CXF_JAXWS_CLIENT_BUS_SELECTOR;
+
 import java.io.File;
 import java.net.URL;
 import java.util.LinkedList;
@@ -69,7 +71,28 @@
 
    public static Test suite()
    {
-      return new JBossWSCXFTestSetup(ServletTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
+      return new JBossWSCXFTestSetup(ServletTestCase.class, JBossWSTestHelper.writeToFile(createDeployments())) {
+          /// see https://issues.jboss.org/browse/JBWS-3832
+          private static final String PROPERTY_NAME = JBWS_CXF_JAXWS_CLIENT_BUS_SELECTOR;
+          private static final String SPRING_BUS_SELECTOR = "org.jboss.wsf.stack.cxf.client.SpringCustomClientBusSelector";
+          private static final String DEFAULT_BUS_SELECTOR = "org.jboss.wsf.stack.cxf.client.ClientBusSelector";
+
+          private String formerValue;
+
+          @Override
+          public void setUp() throws Exception {
+              formerValue = JBossWSTestHelper.setSystemProperty(PROPERTY_NAME, DEFAULT_BUS_SELECTOR);
+              super.setUp();
+          }
+          
+
+          @Override
+          public void tearDown() throws Exception {
+              super.tearDown();
+              JBossWSTestHelper.setSystemProperty(PROPERTY_NAME, formerValue);
+              formerValue = null;
+          }
+      };
    }
    
    public void test() throws Exception
Index: modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/in_container_client/cxf-client.xml
===================================================================
--- modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/in_container_client/cxf-client.xml	(revision 0)
+++ modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/in_container_client/cxf-client.xml	(working copy)
@@ -0,0 +1,17 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://cxf.apache.org/core"
+	xsi:schemaLocation="http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd 
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+		">
+
+	<bean id="cxf.default.workqueue" class="org.apache.cxf.workqueue.AutomaticWorkQueueImpl">
+		<property name="name" value="cxf.default.workqueue" />
+		<property name="queueSize" value="20" />
+	</bean>
+	<bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
+	<cxf:bus>
+		<cxf:outInterceptors>
+			<ref bean="logOutbound" />
+		</cxf:outInterceptors>
+	</cxf:bus>
+</beans>
\ No newline at end of file
