Re: automatic management of cookie

2003-06-25 Thread Michael Becke
Amit,

Yes, I think Oleg is correct.  You need to perform a get from the server 
before the post so that a cookie is set.  Doing a get on 
http://www2.ipdl.jpo.go.jp/beginner_tm/TM_AREA.cgi set the following cookie:

Set-Cookie: Name=BE21056561003 StartTime=2003/06/26 02:10:03 
domain=jpo.go.jp Path=/beginner_tm Experies=Thu, 26-Jun-2003 02:10:03 GMT

Mike

Amit Rana wrote:
Hello Michael,

 Thank you for the reply.


What exactly is the problem you are having?  Is HttpClient throwing
exceptions when it tries to parse the cookies from this server?
I am sorry for not writing clearly before.

I am trying to access a site which gives me a fixed response "Server is
busy please try later". This seems to be a canned response which I get
from my browser only when I disable cookies. Otherwise I have never
received this response on a browser.
Please feel free to correct me if I am wrong
1. Either the server has some check and sends a canned response for
anybody trying to access using a program, I think this should not be the
case because only way they can find the client is by User-agent which
can be set or
2. My browser gives same response code when cookies are disabled so I
want to make sure it is not a cookie problem.
I am trying to perform a Japanese trademark search on this site
http://www2.ipdl.jpo.go.jp/beginner_tm/TM_AREA.cgi (NOTE: if you want to
try it, text box expects only double byte input)
PFA the log. I highly appreciate your help.

Regards,
Amit.

-Original Message-
From: Michael Becke [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 11:46 AM
To: Commons HttpClient Project
Subject: Re: automatic management of cookie
Hello Amit,


HttpClient client = new HttpClient();
client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);
HttpMethod method = new GetMethod(url);
Int statusCode = client.executeMethod(method);
This will configure HttpClient to use the compatibility cookie mode.
This is not necessarily required but is probably best to ensure
correct

cookie handling.


Please feel free to point me to a document/link which can give more
information about the same.
I am trying to connect to a website which needs cookie support
from the client. I am getting same response while trying to connect
from
httpclient which I get when I access the site with cookies disabled
in

my browser.
The cookie documentation on the HttpClient site is about all there is.
There's not too much more to it.
What exactly is the problem you are having?  Is HttpClient throwing
exceptions when it tries to parse the cookies from this server?
Please take a look at the trouble shooting guide
<http://jakarta.apache.org/commons/httpclient/troubleshooting.html>
for

some more things to look at.  If this is not helpful in resolving the
problem please post a wire log to the mailing list that shows the
problematic transmission, see
<http://jakarta.apache.org/commons/httpclient/logging.html> for how to
create a wire log.
Mike

-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


2003/06/25 11:59:55:714 JST [DEBUG] HttpClient - -Java version: 1.4.1_01
2003/06/25 11:59:55:714 JST [DEBUG] HttpClient - -Java vendor: Sun Microsystems Inc.
2003/06/25 11:59:55:714 JST [DEBUG] HttpClient - -Java class path: 
E:\Solis-work\solismark\WEB-INF\classes;E:\Solis-work\solismark\WEB-INF\lib\commons-httpclient-2.0-beta1.jar;E:\Solis-work\solismark\WEB-INF\lib\commons-logging-1.0.2.jar;E:\Solis-work\solismark\WEB-INF\lib\htmlparser.jar
2003/06/25 11:59:55:714 JST [DEBUG] HttpClient - -Operating system name: Windows XP
2003/06/25 11:59:55:714 JST [DEBUG] HttpClient - -Operating system architecture: x86
2003/06/25 11:59:55:714 JST [DEBUG] HttpClient - -Operating system version: 5.1
2003/06/25 11:59:56:175 JST [DEBUG] HttpClient - -SUN 1.2: SUN (DSA key/parameter 
generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS 
keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores)
2003/06/25 11:59:56:175 JST [DEBUG] HttpClient - -SunJSSE 1.41: Sun JSSE 
provider(implements RSA Signatures, PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)
2003/06/25 11:59:56:175 JST [DEBUG] HttpClient - -SunRsaSign 1.0: SUN's provider for 
RSA signatures
2003/06/25 11:59:56:175 JST [DEBUG] HttpClient - -SunJCE 1.4: SunJCE Provider 
(implements DES, Triple DES, Blowfish, PBE, Diffie-Hellman, HMAC-MD5, HMAC-SHA1)
2003/06/25 11:59:56:175 JST [DEBUG] HttpClient - -SunJGSS 1.0: Sun (Kerberos v5)
2003/06/25 11:59:56:285 JST [TRACE] GetMethod - -enter GetMethod(String)
2003/06/25 11:59:56:305 JST [TRACE] HttpMethod - 
-HttpMethodBase.addRequestHeader(Header)
2003/06/25 11:59:56:305 JST [TRACE] HttpMethod - 
-HttpMethodBase.addRequestHeader(Header)
2003/06/25 11:

RE: automatic management of cookie

2003-06-25 Thread Ralph Goers
Have you checked all the responses?  Our site uses javascript to determine 
if the browser supports cookies. If the javascript cannot store a cookie 
then further requests are rejected.

Ralph



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: automatic management of cookie

2003-06-25 Thread Oleg Kalnichevski
Amit,

Sorry. It is indeed the log I was asking about. 

If you cookie theory is right, I think before you execute POST request
you have to make sure that you get the cookie set by the target host.
You should execute a GET request to a URL that returns the cookie that
the target host expects to find in your POST request. You will see
something like 'Set-Cookie: whatever' in the wire log. Without knowing
how that CGI script has been programmed, unfortunately I am unable to
help you any further.

Oleg

On Wed, 2003-06-25 at 10:40, Amit Rana wrote:
> Hello Oleg,
> 
>  Thanks for your response.
> 
> > However, it is just a guess. We will be able to give more definitive
> > answers if you provide us with the wire log of the HTTP session in
> > question.
> The file I attached in my last message in reply of Michael's comment
> isn't that the log?
> 
> That file contains the stdout after I followed the instructions given on
> the link. 
> 
> Please feel free to point out if I need to do something else or if I
> should resend the file.
> 
> Regards,
> Amit.
> 
> > -Original Message-
> > From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, June 25, 2003 5:34 PM
> > To: Commons HttpClient Project
> > Subject: RE: automatic management of cookie
> > 
> > Amin,
> > 
> > It is not quite clear what is going on there. My best guess it that
> the
> > cookie sent by the target host is malformed and as such rejected by
> > HttpClient.
> > 
> > However, it is just a guess. We will be able to give more definitive
> > answers if you provide us with the wire log of the HTTP session in
> > question.
> > 
> > Please have a look at the logging guide for more details
> > 
> > http://jakarta.apache.org/commons/httpclient/logging.html
> > 
> > Oleg
> 
> 
> -
> 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]



RE: automatic management of cookie

2003-06-25 Thread Amit Rana
Hello Oleg,

 Thanks for your response.

> However, it is just a guess. We will be able to give more definitive
> answers if you provide us with the wire log of the HTTP session in
> question.
The file I attached in my last message in reply of Michael's comment
isn't that the log?

That file contains the stdout after I followed the instructions given on
the link. 

Please feel free to point out if I need to do something else or if I
should resend the file.

Regards,
Amit.

> -Original Message-
> From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 25, 2003 5:34 PM
> To: Commons HttpClient Project
> Subject: RE: automatic management of cookie
> 
> Amin,
> 
> It is not quite clear what is going on there. My best guess it that
the
> cookie sent by the target host is malformed and as such rejected by
> HttpClient.
> 
> However, it is just a guess. We will be able to give more definitive
> answers if you provide us with the wire log of the HTTP session in
> question.
> 
> Please have a look at the logging guide for more details
> 
> http://jakarta.apache.org/commons/httpclient/logging.html
> 
> Oleg


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: automatic management of cookie

2003-06-25 Thread Oleg Kalnichevski
Amin,

It is not quite clear what is going on there. My best guess it that the
cookie sent by the target host is malformed and as such rejected by
HttpClient.

However, it is just a guess. We will be able to give more definitive
answers if you provide us with the wire log of the HTTP session in
question.

Please have a look at the logging guide for more details

http://jakarta.apache.org/commons/httpclient/logging.html

Oleg

On Wed, 2003-06-25 at 05:12, Amit Rana wrote:
> Hello Michael,
> 
>  Thank you for the reply.
> 
> > What exactly is the problem you are having?  Is HttpClient throwing
> > exceptions when it tries to parse the cookies from this server?
> I am sorry for not writing clearly before.
> 
> I am trying to access a site which gives me a fixed response "Server is
> busy please try later". This seems to be a canned response which I get
> from my browser only when I disable cookies. Otherwise I have never
> received this response on a browser.
> 
> Please feel free to correct me if I am wrong
> 1. Either the server has some check and sends a canned response for
> anybody trying to access using a program, I think this should not be the
> case because only way they can find the client is by User-agent which
> can be set or
> 2. My browser gives same response code when cookies are disabled so I
> want to make sure it is not a cookie problem.
> 
> I am trying to perform a Japanese trademark search on this site
> http://www2.ipdl.jpo.go.jp/beginner_tm/TM_AREA.cgi (NOTE: if you want to
> try it, text box expects only double byte input)
> 
> PFA the log. I highly appreciate your help.
> 
> Regards,
> Amit.
> 
> > -Original Message-
> > From: Michael Becke [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, June 25, 2003 11:46 AM
> > To: Commons HttpClient Project
> > Subject: Re: automatic management of cookie
> > 
> > Hello Amit,
> > 
> > > HttpClient client = new HttpClient();
> > > client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);
> > > HttpMethod method = new GetMethod(url);
> > > Int statusCode = client.executeMethod(method);
> > 
> > This will configure HttpClient to use the compatibility cookie mode.
> > This is not necessarily required but is probably best to ensure
> correct
> > cookie handling.
> > 
> > > Please feel free to point me to a document/link which can give more
> > > information about the same.
> > >
> > >   I am trying to connect to a website which needs cookie support
> > > from the client. I am getting same response while trying to connect
> > > from
> > > httpclient which I get when I access the site with cookies disabled
> in
> > > my browser.
> > 
> > The cookie documentation on the HttpClient site is about all there is.
> > There's not too much more to it.
> > 
> > What exactly is the problem you are having?  Is HttpClient throwing
> > exceptions when it tries to parse the cookies from this server?
> > 
> > Please take a look at the trouble shooting guide
> > <http://jakarta.apache.org/commons/httpclient/troubleshooting.html>
> for
> > some more things to look at.  If this is not helpful in resolving the
> > problem please post a wire log to the mailing list that shows the
> > problematic transmission, see
> > <http://jakarta.apache.org/commons/httpclient/logging.html> for how to
> > create a wire log.
> > 
> > Mike
> > 
> > 
> > -
> > 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]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: automatic management of cookie

2003-06-24 Thread Amit Rana
Hello Michael,

 Thank you for the reply.

> What exactly is the problem you are having?  Is HttpClient throwing
> exceptions when it tries to parse the cookies from this server?
I am sorry for not writing clearly before.

I am trying to access a site which gives me a fixed response "Server is
busy please try later". This seems to be a canned response which I get
from my browser only when I disable cookies. Otherwise I have never
received this response on a browser.

Please feel free to correct me if I am wrong
1. Either the server has some check and sends a canned response for
anybody trying to access using a program, I think this should not be the
case because only way they can find the client is by User-agent which
can be set or
2. My browser gives same response code when cookies are disabled so I
want to make sure it is not a cookie problem.

I am trying to perform a Japanese trademark search on this site
http://www2.ipdl.jpo.go.jp/beginner_tm/TM_AREA.cgi (NOTE: if you want to
try it, text box expects only double byte input)

PFA the log. I highly appreciate your help.

Regards,
Amit.

> -Original Message-
> From: Michael Becke [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 25, 2003 11:46 AM
> To: Commons HttpClient Project
> Subject: Re: automatic management of cookie
> 
> Hello Amit,
> 
> > HttpClient client = new HttpClient();
> > client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);
> > HttpMethod method = new GetMethod(url);
> > Int statusCode = client.executeMethod(method);
> 
> This will configure HttpClient to use the compatibility cookie mode.
> This is not necessarily required but is probably best to ensure
correct
> cookie handling.
> 
> > Please feel free to point me to a document/link which can give more
> > information about the same.
> >
> > I am trying to connect to a website which needs cookie support
> > from the client. I am getting same response while trying to connect
> > from
> > httpclient which I get when I access the site with cookies disabled
in
> > my browser.
> 
> The cookie documentation on the HttpClient site is about all there is.
> There's not too much more to it.
> 
> What exactly is the problem you are having?  Is HttpClient throwing
> exceptions when it tries to parse the cookies from this server?
> 
> Please take a look at the trouble shooting guide
> <http://jakarta.apache.org/commons/httpclient/troubleshooting.html>
for
> some more things to look at.  If this is not helpful in resolving the
> problem please post a wire log to the mailing list that shows the
> problematic transmission, see
> <http://jakarta.apache.org/commons/httpclient/logging.html> for how to
> create a wire log.
> 
> Mike
> 
> 
> -
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
2003/06/25 11:59:55:714 JST [DEBUG] HttpClient - -Java version: 1.4.1_01
2003/06/25 11:59:55:714 JST [DEBUG] HttpClient - -Java vendor: Sun Microsystems Inc.
2003/06/25 11:59:55:714 JST [DEBUG] HttpClient - -Java class path: 
E:\Solis-work\solismark\WEB-INF\classes;E:\Solis-work\solismark\WEB-INF\lib\commons-httpclient-2.0-beta1.jar;E:\Solis-work\solismark\WEB-INF\lib\commons-logging-1.0.2.jar;E:\Solis-work\solismark\WEB-INF\lib\htmlparser.jar
2003/06/25 11:59:55:714 JST [DEBUG] HttpClient - -Operating system name: Windows XP
2003/06/25 11:59:55:714 JST [DEBUG] HttpClient - -Operating system architecture: x86
2003/06/25 11:59:55:714 JST [DEBUG] HttpClient - -Operating system version: 5.1
2003/06/25 11:59:56:175 JST [DEBUG] HttpClient - -SUN 1.2: SUN (DSA key/parameter 
generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS 
keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores)
2003/06/25 11:59:56:175 JST [DEBUG] HttpClient - -SunJSSE 1.41: Sun JSSE 
provider(implements RSA Signatures, PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)
2003/06/25 11:59:56:175 JST [DEBUG] HttpClient - -SunRsaSign 1.0: SUN's provider for 
RSA signatures
2003/06/25 11:59:56:175 JST [DEBUG] HttpClient - -SunJCE 1.4: SunJCE Provider 
(implements DES, Triple DES, Blowfish, PBE, Diffie-Hellman, HMAC-MD5, HMAC-SHA1)
2003/06/25 11:59:56:175 JST [DEBUG] HttpClient - -SunJGSS 1.0: Sun (Kerberos v5)
2003/06/25 11:59:56:285 JST [TRACE] GetMethod - -enter GetMethod(String)
2003/06/25 11:59:56:305 JST [TRACE] HttpMethod - 
-HttpMethodBase.addRequestHeader(Header)
2003/06/25 11:59:56:305 JST [TRACE] HttpMethod - 
-HttpMethodBase.addRequestHeader(Header)
2003/06/25 11:59:56:305 JST [TRACE] HttpMethod - 
-HttpMethodBase.addRequestHeader(Header)
2003/06/25 11:59:56:305 JST [TRACE] HttpMethod - 
-HttpMethodBase.addRequestHeader(Header

Re: automatic management of cookie

2003-06-24 Thread Michael Becke
Hello Amit,

HttpClient client = new HttpClient();
client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);
HttpMethod method = new GetMethod(url);
Int statusCode = client.executeMethod(method);
This will configure HttpClient to use the compatibility cookie mode.  
This is not necessarily required but is probably best to ensure correct 
cookie handling.

Please feel free to point me to a document/link which can give more
information about the same.
	I am trying to connect to a website which needs cookie support
from the client. I am getting same response while trying to connect 
from
httpclient which I get when I access the site with cookies disabled in
my browser.
The cookie documentation on the HttpClient site is about all there is.  
There's not too much more to it.

What exactly is the problem you are having?  Is HttpClient throwing 
exceptions when it tries to parse the cookies from this server?

Please take a look at the trouble shooting guide 
 for 
some more things to look at.  If this is not helpful in resolving the 
problem please post a wire log to the mailing list that shows the 
problematic transmission, see 
 for how to 
create a wire log.

Mike

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]