Tried with the code given above:
NTCredentials creds = new NTCredentials(userName, password, hostAdd, "" );
HostConfiguration hostConfig = new HostConfiguration();
hostConfig.setHost(hostAdd); //Not url, just ip address or fully qualified DN
HttpURL host = new HttpURL("http://" + hostUrl);
WebdavResource res = new WebdavResource(host, (Credentials)creds, WebdavResource.DEFAULT, DepthSupport.DEPTH_1);
However, I see an authentication-warning message saying "Already tried to authenticate with null authentication realm at <exchange server name>, but still receiving: HTTP/1.1 401 Access Denied". Proceeding furhter with the method "WebdavResource.list ();" gives a NullPointerException.
Am I doing something wrong? Do I need to setup my Tomcat to redirect the authentication to MS Exchange server? Please help.
Thanks in advance.