[SWS-214] Setting Basic Authentication preemptive through CommonsHttpMessageSender Created: 18/Oct/07  Updated: 04/May/12  Resolved: 21/Jul/08

Status: Closed
Project: Spring Web Services
Component/s: Core
Affects Version/s: 1.0.1
Fix Version/s: 1.5.4

Type: Improvement Priority: Major
Reporter: Mike Wiesner Assignee: Arjen Poutsma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When using CommonsHttpMessageSender in the WebServiceTemplate to support Basic Authentication (with setCredentials()), it should also delegate the Method getParams().setAuthenticationPreemptive(true) from the underlaying HttpClient to avoid a roundtrip and to always use the actual username/password if it changes during the requests.

Currently you can do that with this code:

WebServiceTemplate template = new WebServiceTemplate();
CommonsHttpMessageSender sender = new CommonsHttpMessageSender();
sender.setCredentials(new MyCredentials());
sender.getHttpClient().getParams().setAuthenticationPreemptive(true);
sender.afterPropertiesSet();
template.setMessageSender(sender);



 Comments   
Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Thu Dec 14 15:01:06 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.