Here's the piece of code I'm using:
public class BasicAuthenticatonExample {
public BasicAuthenticatonExample() {
}
public static void main(String[] args) throws Exception {
System.setProperty("org.apache.commons.logging.Log",
"org.apache.commons.logging.impl.SimpleLog");
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire",
"debug");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient",
"debug");
HttpClient client = new HttpClient();
client.setTimeout(0);
client.setConnectionTimeout(5000);
client.getState().setProxyCredentials(null,"myProxyHost",
new NTCredentials("myUsername", "mypass", "myProxyHost", "myDomain")
);
HostConfiguration config = new HostConfiguration();
config.setProxy("myProxyHost", 80);
client.setHostConfiguration(config);
GetMethod get = new GetMethod("http://www.yahoo.com");
get.setDoAuthentication( true );
// execute the GET
int status = client.executeMethod( get );
// print the status and response
System.out.println(status + "\n" + get.getResponseBodyAsString());
// release any connection resources used by the method
get.releaseConnection();
}
}
Is there anything blatantly obvious here? All I need to do is be able to access
internet resources, through a Proxy (ISA) that uses NTLM Authentication.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]