Oleg,
I appreciate the quick reply. I added the setUseExpectHeader(true) call on
my PostMethod object. It didn't work, but I am receiving a different error
message, a SocketException....here is the specific stacktrace:
java.net.SocketException: Socket Closed
at java.net.PlainSocketImpl.setOption(PlainSocketImpl.java:201)
at java.net.Socket.setSoTimeout(Socket.java:979)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.setSoTimeout(SSLSocketImpl.java:1
928)
at
org.apache.commons.httpclient.HttpConnection.setSoTimeout(HttpConnection.jav
a:589)
at
org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.jav
a:2306)
at
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.j
ava:2651)
at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:108
7)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:643)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:497)
I'm aware of the obscurities revolving doing such screen-scraping on
e-commerce sites, which does seem to be my problem in this case. I've gone
through and examined every request/response that occurs when logging-in
through my browser, and I've made sure that I haven't missed anything with
the process I'm trying to build with HttpClient. I even had to decode
through a fairly large javascript include file in order to determine how to
set the js cookies appropriately. Everything seems to fall in-line, with
the exception of this Connection being dropped during log-in. Let me know
if you would like to take a glimpse at the code I have to make sure I'm not
pulling some newbie-related error. If you have any experience with working
through any stubborn e-commerce sites like this in order to get them
working, I would definitely appreciate those pointers.
Thanks again,
Brent
-----Original Message-----
From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED]
Sent: Monday, November 08, 2004 3:40 AM
To: 'Jakarta Commons Users List'
Subject: Re: [HTTPClient] MethodRetryHandler.retryMethod() returned false
Brant,
All I can tell you is that the target server dropped the connection
while HttpClient was still reading the response.
Try using the so called expect-continue handshake and see if it makes
any difference.
http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/http
client/methods/ExpectContinueMethod.html#setUseExpectHeader(boolean)
Many e-commerce sites do tricks to make automated HTML scraping VERY
difficult, so do expect it to take some efforts
Oleg
On Sun, Nov 07, 2004 at 10:22:04PM -0500, Brant Hahn wrote:
> Hi,
>
>
>
> I've returned to my attempts to use HttpClient to log-in to my bank's
> website. I post my log-in variables, and execute the post method to do
the
> log-in. I get the following warning and stacktrace when executed:
>
>
>
> WARNING: Recoverable exception caught but MethodRetryHandler.retryMethod()
> returned false, rethrowing exception
>
> org.apache.commons.httpclient.HttpRecoverableException:
> java.net.SocketException: Connection reset
>
> at
>
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.jav
> a:1962)
>
> at
>
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.j
> ava:2653)
>
> at
>
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:108
> 7)
>
> at
>
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:643)
>
> at
>
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:497)
>
>
>
> Before this, I was getting a redirect response taking me to a failed login
> page. I had noticed that on the log-in page itself, there is some
> javascripting that adds two cookies. Once I manually create those Cookies
> and added them to my HttpClient object's HttpState attribute, then
re-tried
> the log-in attempt, I receive this connection reset error. It seems that
> once I had added those two cookies, which are required, it is making the
> attempt to establish my log-in session.but this appears to be preventing
it
> from happening. Any tips on what could be done here or what is happning
to
> my connection? I'm using JRE 1.5 and v2.0.2 for HTTPClient.
>
>
>
> Thanks,
>
> Brett
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]