title: WebSphere Spring Apache CXF SOAP WebService Client timeout not working
body: <p>I need to configure a SOAP WebService client with certain timeout values for connection attempts and service invocations.</p>
  
  <p>The WS client is a jar dependency generated using the WSDL with Maven cxf-codegen-plugin. I use this client jar in my web app as a maven dependency and invoke the service operations.</p>
  
  <p>So my webapp pom contains:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;my.web.service&lt;/groupId&gt;
      &lt;artifactId&gt;web-service-client-jar&lt;/artifactId&gt;
      &lt;version&gt;x.x.x&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>along with the Apache CXF dependencies:</p>
  
  <pre><code>&lt;!-- CXF dependencies --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
      &lt;artifactId&gt;cxf-rt-frontend-jaxws&lt;/artifactId&gt;
      &lt;version&gt;${cxf.version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
      &lt;artifactId&gt;cxf-rt-transports-http&lt;/artifactId&gt;
      &lt;version&gt;${cxf.version}&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>And I have defined below spring configuration to setup timeouts which does not work..</strong></p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd"&gt;
  
   &lt;http-conf:conduit name="*.http-conduit"&gt;
      &lt;http-conf:client ConnectionTimeout="20000" ReceiveTimeout="10000" /&gt;
  &lt;/http-conf:conduit&gt;
  
  &lt;cxf:bus&gt;
      &lt;cxf:outInterceptors&gt;
          &lt;ref bean="fileuploadlogOutbound" /&gt;
      &lt;/cxf:outInterceptors&gt;
  &lt;/cxf:bus&gt;
  
  &lt;!-- Outbound Message Logging --&gt;
  &lt;bean id="fileuploadlogOutbound" class="test.logging.MyLoggingOutInterceptor"&gt;
      &lt;property name="prettyLogging" value="true" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>But to my confusion, the outInterceptors defined for pretty logging works fine. Hence, I doubt if my configuration has any errors or not. FYI I'm trying to get this working in WebSphere 8.5 environment. </p>
  
  <p>This is how I instantiate the WS Client in spring:</p>
  
  <pre><code>&lt;jaxws:client id="documentUploadServiceJaxwsClient"
      serviceClass="org.tempuri.IDocumentUploadService" address="#serviceEndpointString" &gt;
  
      &lt;jaxws:binding&gt;
          &lt;soap:soapBinding version="1.2" mtomEnabled="true" /&gt;
      &lt;/jaxws:binding&gt;
  &lt;/jaxws:client&gt;
  </code></pre>
  
  <p>Is there any steps missing in Spring config or do I need to look into WebSphere 8.5 specific configuration which will enforce HTTP/SOAP connection &amp; response timeouts?</p>