You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by bu...@apache.org on 2003/05/15 21:42:53 UTC

DO NOT REPLY [Bug 19969] New: - Problems with PostMethod

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19969>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19969

Problems with PostMethod

           Summary: Problems with PostMethod
           Product: Commons
           Version: Nightly Builds
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: HttpClient
        AssignedTo: commons-httpclient-dev@jakarta.apache.org
        ReportedBy: okhali1@yahoo.ca


Hey,

I'm not so sure if this is the right place to post this problem. Consider the 
following set-up: My java servlet is using HttpClient (build of 15th May) to 
get NTLM validation for an IIS 5.0 web-server. I use GetMethod to make certain 
queries over the server. For the first query the NTLM validation goes through 
fine. For the subsequent validations I get the following debug message : 
[INFO] HttpMethod - -Already tried to authenticate to "<domain_name>#" but 
still receiving 401.

Does anyone have any clue how to fix this problem. The weird thing is that when 
I use a simple test program (not a servlet ) to make the similar calls to 
HttpClient.executemethod it goes through just fine. The following is a sample 
that I run through the test program 

	// try doing a get-method more than once
	for (int i = 0; i < 2; i++) { 
		System.out.println("Request id " + i);
		HttpClient client = new HttpClient();
		// an arbitrary realm change this to null.
		String n = "USERNAME";
		String p = "PASSWORD";
		String h = "HOST";
		String d = "DOMAIN";
		client.getState().setCredentials( null, new NTCredentials(n, p, 
h, d));
		GetMethod get = new GetMethod("<URL>");
		
get.setDoAuthentication( true );
// *** Yes these cookies are valid
		get.addRequestHeader("Cookie", "LLInProgress=%
2FE5Mj4pPiIwMD4hNDM3Py8gAA; LLCookie=%
2FE5Mj4pPiIwMD4hNDM3PExJMTFETUlOTyFEbWlubyxpZnVsaW5rbyAAAA; LLTZCookie=0;");
	        
		// 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();
	    
} 

Any help would be appreciated.

Thanks

O.K