int domainIndex = this.getProxyUser().indexOf("\\");
if (domainIndex > 0) {
String domain = this.getProxyUser().substring(0, domainIndex);
if (this.getProxyUser().length() > domainIndex + 1) {
String user = this.getProxyUser().substring(domainIndex + 1);
proxyCred = new NTCredentials(user,
this.getProxyPassword(),
this.getProxyHost(),
domain);
}
}
}
}
// Overide the property setting in runtime.
HttpTransportProperties.ProxyProperties proxyProperties =
(HttpTransportProperties.ProxyProperties) messageContext
.getProperty(HTTPConstants.PROXY);
if (proxyProperties != null) {
String host = proxyProperties.getProxyHostName();
if (host == null || host.length() == 0) {
throw new AxisFault(ProxyConfiguration.class.getName() +
" Proxy host is not available. Host is a MUST parameter");
} else {
this.setProxyHost(host);
}
this.setProxyPort(proxyProperties.getProxyPort());
//Setting credentials
String userName = proxyProperties.getUserName();
String password = proxyProperties.getPassWord();
String domain = proxyProperties.getDomain();
if (userName == null && password == null) {
proxyCred = new UsernamePasswordCredentials("", "");
} else {
proxyCred = new UsernamePasswordCredentials(userName, password);
}
if (userName != null && password != null && domain != null) {
proxyCred = new NTCredentials(userName, password, host, domain);
}
}
//Using Java Networking Properties