title: How to set different timeouts for different URIs while using WebServiceTemplate and CommonsHttpMessageSender?
body: <p>Hello I have a problem about setting connection timeout. 
  I use WebServiceTemplate and it has 1 messageSender (CommonsHttpMessageSender). 
  But is it possible to set different connection timeouts for each URIs(endpoints)?</p>
  
  <p>Sincerely...</p>
  
  <pre><code>public Message sendRequest(OutgoingRequest message, MessageHeaders headers,
                          EndpointInfoProvider endpointInfoProvider,
                          WebServiceMessageCallback requestCallback){
      Assert.notNull(endpointInfoProvider, "Destination provider is required!");
      final Credentials credentials = endpointInfoProvider.getCredentials();
      URI destinationUri = endpointInfoProvider.getDestination();
      for (WebServiceMessageSender messageSender : webServiceTemplate.getMessageSenders()) {
          if (messageSender instanceof CommonsHttpMessageSender) {
              HttpClient httpClient = ((CommonsHttpMessageSender) messageSender).getHttpClient();
              httpClient.getState().setCredentials(
                      new AuthScope(destinationUri.getHost(),
                              destinationUri.getPort(), AuthScope.ANY_REALM,
                              AuthScope.ANY_SCHEME), credentials
              );
              httpClient.getParams().setAuthenticationPreemptive(true);
              ((CommonsHttpMessageSender) messageSender)
                      .setConnectionTimeout(endpointInfoProvider
                              .getTimeOutDuration());
          }
      }
      webServiceTemplate.setDestinationProvider(endpointInfoProvider);
      //........
  }
  </code></pre>