We were using RestTemplate with xml configuration in Spring 3.0 and it was working perfectly fine.
<bean id="httpClient" class="org.apache.commons.httpclient.HttpClient">
<!-- <constructor-arg ref="httpClientParams"/> -->
</bean>
<bean id="httpClientFactory" class="org.springframework.http.client.CommonsClientHttpRequestFactory">
<constructor-arg ref="httpClient"/>
</bean>
<bean id="restTemplate" name="restTemplate" class="org.springframework.web.client.RestTemplate" autowire-candidate="true">
<constructor-arg ref="httpClientFactory" />
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
</bean>
<bean class="org.springframework.http.converter.FormHttpMessageConverter"/>
<bean class="org.springframework.http.converter.StringHttpMessageConverter" />
</list>
</property>
</bean>
But, when we are trying to migrate to Spring 3.1 release CommonsClientHttpRequestFactory class is deprecated and also commons HttpClient is not used anymore.
I was trying to set up similar config using HttpComponentsClientHttpRequestFactory class and Apache HttpClient, but not getting how can I set the Credential Provider.
We want the httpclient with basic auth. Has anybody done this or any pointers would be great help. Thanks in Advance.