} else {
proxyCred = new UsernamePasswordCredentials(usrName,
passwd); // proxy
}
} else {
proxyCred = new NTCredentials(usrName, passwd, proxyHostName,
domain); // NTLM authentication with additionals prams
}
}
HttpTransportProperties.ProxyProperties proxyProperties =
(HttpTransportProperties.ProxyProperties) msgCtx
.getProperty(HTTPConstants.PROXY);
if (proxyProperties != null) {
if (proxyProperties.getProxyPort() != -1) {
proxyPort = proxyProperties.getProxyPort();
}
if (!proxyProperties.getProxyHostName().equals("")
|| (proxyProperties.getProxyHostName() != null)) {
proxyHostName = proxyProperties.getProxyHostName();
} else {
throw new AxisFault("Proxy Name is not valid");
}
if (proxyProperties.getUserName().equals(ANONYMOUS)
|| proxyProperties.getPassWord().equals(ANONYMOUS)) {
proxyCred = new UsernamePasswordCredentials("", "");
}
if (!proxyProperties.getUserName().equals(ANONYMOUS) &&
!proxyProperties.getPassWord().equals(ANONYMOUS)) {
proxyCred = new UsernamePasswordCredentials(
proxyProperties.getUserName().trim(),
proxyProperties
.getPassWord().trim()); // Basic Authentication
}
if (!proxyProperties.getDomain().equals(ANONYMOUS)) {
if (!proxyProperties.getUserName().equals(ANONYMOUS) &&
!proxyProperties.getPassWord().equals(ANONYMOUS) &&
!proxyProperties.getDomain().equals(ANONYMOUS) &&
proxyHostName != null) {
proxyCred = new NTCredentials(
proxyProperties.getUserName().trim(),
proxyProperties.getPassWord().trim(), proxyHostName,
proxyProperties
.getDomain().trim()); // NTLM Authentication
}