When I enable IIS NT Authentication I am setting :
//client is XFire Client
client.setProperty(Channel.USERNAME, "username");
client.setProperty(Channel.PASSWORD, "mypass");
This works for IIS Basic Authentication, but when I try NT Authentication I use the same method as above, but also add the domain name:
//client is XFire Client
client.setProperty(Channel.USERNAME, "mydomain\username");
client.setProperty(Channel.PASSWORD, "mypass");
On both cases, using this method to set the Username/Password sets the State object in CommonsHttpMessageSender.state object, but not in the CommonsHttpMessageSender.client.state object. NTLM Authentication appears to fail because of this. When testing a web service call by using HttpClient directly, NTLM works fine as the state object is correct.
Maybe I am doing something wrong?
I have had to get round this by overriding
HttpClientParams params = (HttpClientParams) HttpClientParams.getDefaultParams();
params.setAuthenticationPreemptive(true);
params.setParameter(CredentialsProvider.PROVIDER, new WSCredentialsProvider(wss.getHttpUsername(), wss.getHttpPassword()));
client.setProperty(CommonsHttpMessageSender.HTTP_CLIENT_PARAMS, params);
By invoking my WSCredentialsProvider which does exactly the same as the getCredentials() method in CommonsHttpMessageSender seems to resolve this issue.
Steve