commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashraf Fouad" <>
Subject httpclient: Behined ISA proxy server and need to reach Internet site
Date Tue, 31 Aug 2004 09:03:34 GMT

My client machine accesses the Internet through a proxy, I'm writing
http client program to download page source from the Internet, here is
my code:


    HttpClient client = new HttpClient();

    HostConfiguration hostConfiguration = client.getHostConfiguration();

    hostConfiguration.setProxy( "", "8080" );


    HttpState state = client.getState();

    Credentials proxyCredentials = new UsernamePasswordCredentials(
"username", "password" );


    state.setCredentials( "", "",
proxyCredentials );


    PostMethod cnnPost = new PostMethod( "" );

    cnnPost.setDoAuthentication( true );


    client.executeMethod( cnnPost );

    System.out.println( cnnPost.getStatusLine().toString() ); 

    // release any connection resources used by the method





I'm getting the following message:

HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires
authorization to fulfill the request. Access to the Web Proxy service is
denied.  )

[WARN] HttpMethodBase - -No credentials available for the 'null'
authentication realm at

What is wrong with my code.


Thanks, Best regards

Ashraf Fouad Ayoub
S/W Team leader
Raya Software


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message