hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suresh Madireddy" <suresh.madireddy.q...@statefarm.com>
Subject Request for help - httpClient
Date Thu, 22 Jun 2006 12:54:36 GMT
Hi All,

I am  using httpclient 3.0  with WSAD 5.0. I am trying to make Https
call over the proxy. It looks like https call is made successfully, but
I am only getting back javascript as response. I am suppose to get back
a huge html page with lot of content. I appreciate any of your help on
this.

 Here is my code 



	LexisSearchResultTO aLeSearchResult = 
			new LexisSearchResultTO();
		LexisSearchURLBuilder aURL = new
LexisSearchURLBuilder();	
		HttpClient httpclient = new HttpClient();
		httpclient.getHostConfiguration().setProxy("Here is my
proxy", 8008);
		Credentials defaultcreds = new
UsernamePasswordCredentials("XXX", "XXXXXX");
		httpclient.getState().setProxyCredentials(new
AuthScope("Here is my proxy", 8008, AuthScope.ANY_REALM), defaultcreds);
		//GetMethod httpget1 = new
GetMethod("https://www.verisign.com/");
		GetMethod httpget1 = new
GetMethod("https://www.lexis.com/research/");
		GetMethod httpget = new GetMethod(aURL.computeURL());
	
//httpget1.getParams().setCookiePolicy(CookiePolicy.RFC_2109);
	
//httpget.getParams().setCookiePolicy(CookiePolicy.RFC_2109);

		try{
		 
		 
		   httpclient.executeMethod(httpget1);
		   System.out.println(httpget1.getStatusLine());
		   System.out.println(httpget1.getStatusText());
	
System.out.println(httpget1.getResponseBodyAsStream()); 
		   Header[] hea = httpget1.getResponseHeaders();
		   int l = hea.length;
		   for(int i =0; i < l; i++ ){
		   	Header aheader = hea[i];
		   	System.out.println("name =" + aheader.getName()
+ " Value =" + aheader.getValue());
		   	
		   }
		   //byte[] responseBody =
httpget1.getResponseBodyAsStream();
		   BufferedReader in = new BufferedReader( new
InputStreamReader(httpget1.getResponseBodyAsStream())); 
		   String inputLine = "";
			   StringBuffer result = new StringBuffer();
			   while((inputLine = in.readLine()) != null){
				   result.append(inputLine);
			   }
			   System.out.println(result.toString());
			  //
aLeSearchResult.setLexisSearchResult(result.toString());
			   in.close(); 
	
//httpget.setRequestHeader(httpget1.getRequestHeader(""));
		   httpclient.executeMethod(httpget);


		   System.out.println(httpget.getStatusLine());
		   System.out.println(httpget.getStatusText());
		  
		   BufferedReader in1 = new BufferedReader( new
InputStreamReader(httpget.getResponseBodyAsStream())); 
		   String inputLine1 = "";
				   StringBuffer result1 = new
StringBuffer();
				   while((inputLine1 = in1.readLine())
!= null){
					   result1.append(inputLine1);
				   }
	
System.out.println(result1.toString());
				  //
aLeSearchResult.setLexisSearchResult(result1.toString());
				   in1.close(); 
	
		 } finally {
			httpget.releaseConnection();
		   httpget1.releaseConnection();
		 }


Here is log

[6/21/06 12:55:23:642 CDT] 4e85ffb6 SystemOut     O HTTP/1.0 200 OK
[6/21/06 12:55:23:642 CDT] 4e85ffb6 SystemOut     O OK
[6/21/06 12:55:23:642 CDT] 4e85ffb6 SystemOut     O
org.apache.commons.httpclient.AutoCloseInputStream@78d7fab
[6/21/06 12:55:23:642 CDT] 4e85ffb6 SystemOut     O name =Content-Type
Value =text/html
[6/21/06 12:55:23:642 CDT] 4e85ffb6 SystemOut     O name =P3P Value
=CP="IDC DSP LAW ADM DEV TAI PSA PSD IVA IVD CON HIS TEL OUR DEL SAM OTR
IND OTC"
[6/21/06 12:55:23:642 CDT] 4e85ffb6 SystemOut     O name =Expires Value
=Thu, 22 Jun 2006 06:00:00 GMT
[6/21/06 12:55:23:642 CDT] 4e85ffb6 SystemOut     O name =Date Value
=Wed, 21 Jun 2006 17:55:23 GMT
[6/21/06 12:55:23:642 CDT] 4e85ffb6 SystemOut     O name =Set-Cookie
Value
=PC=b08e6b2280bef464183215931ddfcae1d77a7b5cbad0af3806fe163e87932e997ff8
d675c3d758736957fd5601a12b3db5584a0e7e8203eabc52c985691e628d431811e1e84d
2f772cb652acaeba095e1f01d645a98972f632f571495b6120e6d9e1e73b74b5e90c5c25
ed69fe63ef68dd7a2f83ade474ac6f05f8a97ccfbb2f5f65a9046bd1fe6d;
expires=Mon, 20-Jun-2016 17:55:23 GMT; path=/; domain=.lexis.com;
[6/21/06 12:55:23:642 CDT] 4e85ffb6 SystemOut     O name =Set-Cookie
Value
=TC=72b542ee5a8a81fb6a0bdd2bdc074ef637c62daf66e9762cafff1c944d2183010c71
e1a80a12c48eaf474afe207f0528007faaa15c91adbae9734fef3d13327e64d1604d643c
e6b08fee89d0da45de7bb10713197a2201509fb8e48d2cf020a19dadbf725702eed651f8
951cd1bd4f4391cfab3fb54b466cdd4f0fc1b640b43afc50ddda19552452845ba101b366
37b7d197a0288675c52e2ff668e7b0bfea9210ec4a8e0ed64550c5ac08410de3adeea9dd
123347f92ce0cfc3ccd5a80cbf2597db5b7ca7a4790acb03c99f0b378f40a9c158348984
cd0523871a6dfd299c5d43654030b982dd688d334e75fb178b1a4a8df1ae20ea261fb126
b3293ae11026e19b7a8235216db82ddb5ed48f8f63756fe018bd0722643cb0b0ba40e89f
a0862ad4a940d6eae449d0b509cc35dcf12a8dc671e93813231fa57b098ce3fee531477d
2048db836179; path=/; domain=.lexis.com;
[6/21/06 12:55:23:736 CDT] 4e85ffb6 SystemOut     O <html><head><script
src="/ri/commonscript_10-JUN-2006.js"
language="JavaScript"></script><script src="/ri/browser_10-JUN-2006.js"
language="JavaScript"></script><noscript><meta http-equiv="refresh"
content="0;
url=http://www.lexis.com/research/xlink?_m=2b44185a137f04a8c516fd75b2bc9
5c2&wchp=dGLbVlz-zSkAW&_md5=38db1099dd28aceead9275e131cb73c8&USER_AGENT=
&js=0&du=0"></noscript><title>Redirecting</title></head><body><script
language="Javascript"><!--function setDuValue(){var utilVer =
"1,0,9,2";if (typeof(utilVer) == "undefined") return;var pBrowser = new
WebBrowser();if(pBrowser.ie5up) {var funcStr = "try {" +" var
delutil=new ActiveXObject('DAP.DAPCtl.1');" +" if (utilVer <= " +"
delutil.GetVersion()) {" +" du = '1'; " +"}" +"}" +" catch(e) {"
+"}";var cUtil = new Function("utilVer", funcStr);cUtil(utilVer);}else
if(pBrowser.ie4) {if (delutil.object) {if (utilVer <=
delutil.GetVersion()) {du = '1';}}}else {if
(navigator.mimeTypes["application/x-lndap"]) {var installVer;if
(pBrowser.nav6up) {installVer =
document.getElementsByName("delutil").item(0).GetVersion();}else
{installVer = document.delutil.GetVersion();}if (utilVer <= installVer)
{du='1';}}}}var du = "0";setDuValue();var spaces = / /g;var ua =
window.navigator.userAgent;window.location.href="http://www.lexis.com/re
search/xlink?_m=2b44185a137f04a8c516fd75b2bc95c2&wchp=dGLbVlz-zSkAW&_md5
=38db1099dd28aceead9275e131cb73c8" + "&USER_AGENT=" + ua.replace(spaces,
"%20") + "&js=1&du=" + du;// --></script></body></html>
[6/21/06 12:55:23:814 CDT] 4e85ffb6 AuthChallenge I
org.apache.commons.httpclient.

Thanks in advance,
Suresh


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