From httpclient-user-returnjoseph86@example.com Mon Oct 02 08:46:36 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 48961 invoked from network); 2 Oct 2006 08:46:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 08:46:35 -0000 Received: (qmail 2407 invoked by uid 500); 2 Oct 2006 08:46:34 -0000 Delivered-To: joseph86@example.com Received: (qmail 2390 invoked by uid 500); 2 Oct 2006 08:46:34 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 2379 invoked by uid 99); 2 Oct 2006 08:46:34 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 01:46:34 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [83.161.120.155] ([83.161.120.155:58092] helo=wmgmail.langroup.wmg.warwick.ac.uk) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id BA/32-16499-6E1D0254 for <joseph86@example.com>; Mon, 02 Oct 2006 01:46:32 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: RE: How to set a Forms action value? Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Mon, 2 Oct 2006 09:44:21 +0100 Message-ID: <joseph86@example.com> In-Reply-To: <joseph86@example.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How to set a Forms action value? Thread-Index: Acbj70YoeixGr/wsS4WdXnL//eNnCQCDhbxg From: "Jeffrey Porter" <joseph86@example.com> To: "HttpClient User Discussion" <joseph86@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Roland,=20 I've read this but and none the wiser. I have the following in the web page... <SCRIPT LANGUAGE=3D"Javascript" function validateAndSubmit(frm) { frm.action=3D"PartsForSupplier"; frm.submit(); } </SCRIPT> .... <form name=3D"PartsForSupplierForm" method=3D"post"> .... </form> So as you can see the action parameter of the form is set in the javascript. The link you passed over states that the URL that is requested is the target of the form.=20 Using HTTP Analyzer, I can see the following, i.e the URL requested is the same as the action set in the javascript. ---------------------------------------- POST /code/PartsForSupplier HTTP/1.1 Referer: https://web.bakert.com/code/PartsForSupplier ---------------------------------------- So.... My question is, is the action set on the form the same as the URL requested? In my HTTPClient code I post request the URL with the NameValuePairs that are set in the form, but all I get back in the original search page. i.e.=20 the page with no results. Can anyone help me out a bit here? Thanks Jeff porter -----Original Message----- From: Roland Weber [mailto:joseph86@example.com]=20 Sent: 29 September 2006 18:48 To: HttpClient User Discussion Subject: Re: How to set a Forms action value? Hi Jeff, > I'm trying to submit a post request to a page that contains a form with > some values. >=20 > I can set the values, but the page has javascript that sets the form's > action value to 'doStuff'. >=20 > =20 >=20 > How do I set this in my httpclient java code? The action value of the form is the target URL for your POST request. Have you taken a look at the primer? http://wiki.apache.org/jakarta-httpclient/ForAbsoluteBeginners#head-93d0 17d102ea8a83b2ad6e07c5184ec2f922f09a cheers, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com From httpclient-user-returnjoseph86@example.com Mon Oct 02 08:55:12 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 50163 invoked from network); 2 Oct 2006 08:55:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 08:55:12 -0000 Received: (qmail 7488 invoked by uid 500); 2 Oct 2006 08:55:10 -0000 Delivered-To: joseph86@example.com Received: (qmail 7471 invoked by uid 500); 2 Oct 2006 08:55:10 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 7460 invoked by uid 99); 2 Oct 2006 08:55:10 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 01:55:10 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [83.161.120.155] ([83.161.120.155:58414] helo=wmgmail.langroup.wmg.warwick.ac.uk) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id 3B/72-16499-BE3D0254 for <joseph86@example.com>; Mon, 02 Oct 2006 01:55:09 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: RE: How to set a Forms action value? Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Mon, 2 Oct 2006 09:52:58 +0100 Message-ID: <joseph86@example.com> In-Reply-To: <joseph86@example.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How to set a Forms action value? Thread-Index: Acbl/vxBVNl43ZaERgi2x2VQvu6olwAAPhMA From: "Jeffrey Porter" <joseph86@example.com> To: "HttpClient User Discussion" <joseph86@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N SOLVED The URL is the same as the action value of the form. My problem was due to me not setting a NameValuePair. The NameValuePair concered does not have a value, it is... NameValuePair thepart =3D new NameValuePair("part" , ""); I presumed that because it was empty, that is was not used. I was wrong. Jeff porter -----Original Message----- From: Jeffrey Porter [mailto:joseph86@example.com]=20 Sent: 02 October 2006 09:44 To: HttpClient User Discussion Subject: RE: How to set a Forms action value? Hi Roland,=20 I've read this but and none the wiser. I have the following in the web page... <SCRIPT LANGUAGE=3D"Javascript" function validateAndSubmit(frm) { frm.action=3D"PartsForSupplier"; frm.submit(); } </SCRIPT> .... <form name=3D"PartsForSupplierForm" method=3D"post"> .... </form> So as you can see the action parameter of the form is set in the javascript. The link you passed over states that the URL that is requested is the target of the form.=20 Using HTTP Analyzer, I can see the following, i.e the URL requested is the same as the action set in the javascript. ---------------------------------------- POST /code/PartsForSupplier HTTP/1.1 Referer: https://web.bakert.com/code/PartsForSupplier ---------------------------------------- So.... My question is, is the action set on the form the same as the URL requested? In my HTTPClient code I post request the URL with the NameValuePairs that are set in the form, but all I get back in the original search page. i.e.=20 the page with no results. Can anyone help me out a bit here? Thanks Jeff porter -----Original Message----- From: Roland Weber [mailto:joseph86@example.com]=20 Sent: 29 September 2006 18:48 To: HttpClient User Discussion Subject: Re: How to set a Forms action value? Hi Jeff, > I'm trying to submit a post request to a page that contains a form with > some values. >=20 > I can set the values, but the page has javascript that sets the form's > action value to 'doStuff'. >=20 > =20 >=20 > How do I set this in my httpclient java code? The action value of the form is the target URL for your POST request. Have you taken a look at the primer? http://wiki.apache.org/jakarta-httpclient/ForAbsoluteBeginners#head-93d0 17d102ea8a83b2ad6e07c5184ec2f922f09a cheers, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com From httpclient-user-returnjoseph86@example.com Mon Oct 02 09:27:00 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 56672 invoked from network); 2 Oct 2006 09:27:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 09:27:00 -0000 Received: (qmail 37070 invoked by uid 500); 2 Oct 2006 09:27:00 -0000 Delivered-To: joseph86@example.com Received: (qmail 36801 invoked by uid 500); 2 Oct 2006 09:26:59 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 36790 invoked by uid 99); 2 Oct 2006 09:26:59 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 02:26:59 -0700 Authentication-Results: idunn.apache.osuosl.org joseph86@example.com; domainkeys=good X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 Received: from [83.161.120.155] ([83.161.120.155:46652] helo=web36807.mail.mud.yahoo.com) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id D5/53-16499-E5BD0254 for <joseph86@example.com>; Mon, 02 Oct 2006 02:26:55 -0700 Received: (qmail 485 invoked by uid 60001); 2 Oct 2006 09:26:51 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=bGRtaQg8Cqc3XMMNrLH3svBgwA9592ueYn5mBplAknwzMjHYzzqs5s/f7vzzkbkna8HF7Aeg73MeVyiZd/Yj8ArWV+4whzxW9/dXxi+p598ILPtoDaE8Q0NCnKV5p0nGd3U2eMbcO6ugxTcNdGAuyGjSZ4PUj/GeGOk8uXO7ayw= ; Message-ID: <joseph86@example.com> Received: from [83.161.120.155] by web36807.mail.mud.yahoo.com via HTTP; Mon, 02 Oct 2006 02:26:51 PDT Date: Mon, 2 Oct 2006 02:26:51 -0700 (PDT) From: Melvin Mah <joseph86@example.com> Subject: Re: Entity Enclosing Requests To: HttpClient User Discussion <joseph86@example.com> In-Reply-To: <joseph86@example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Oleg, I just referred back to LoginDemo - one of the samples for HTTPClient - to test the Redirect and changed a little using some parameters for the site Engineering Village. Now that the login status is successful, I want to entering a key term and then EV will redirect to another page and send me the results based on the keyword I would enter. Currently, the pointer link is at /Servlet/Controller/CID?=quicksearch&database=1. (after login) The link shown after the search results are returned would be at: The question is can I just simply reuse the last half of PostMethod in LoginDemo (modified) and just adding new NameValuePair variables? Do I have to modify anything substantially? Thanks --- Oleg Kalnichevski <joseph86@example.com> wrote: > Melvin Mah wrote: > > I am currently using HttpClients v3.0.1 and I just > > tried writing a class that utilizes a POST method. > > > > > This class allows inserting of username and > password > > for a website (as parameters) such as SCOPUS, > Emerald, > > etc.. and then once it logs into the website's > > database, the page will be redirected to a subpage > in > > which I can perform my search queries. > > > > For that purpose, I've put in a line - > > > > method.setFollowRedirects > > > > but upon running the program, > > I get the message that 'Entity Enclosing Requests' > > cannot be redirected without user intervention. > > > > I understand that this is in violation with RFC > 2616 > > but somehow I need to redirect it to a subpage. > Any > > workarounds behind this obstacle is very much > appreciated. > > > Melvin, > > You have to handle POST redirects manually because > this requires change > of the method type from POST to GET, which > HttpClient 3.x cannot do > automatically. > > For details see the HttpClient Redirects Handling > guide: > > http://jakarta.apache.org/commons/httpclient/redirects.html > > Hope this helps > > Oleg > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > joseph86@example.com > > For additional commands, e-mail: > joseph86@example.com > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > joseph86@example.com > For additional commands, e-mail: > joseph86@example.com > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com From httpclient-user-returnjoseph86@example.com Mon Oct 02 09:36:42 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 59097 invoked from network); 2 Oct 2006 09:36:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 09:36:42 -0000 Received: (qmail 49675 invoked by uid 500); 2 Oct 2006 09:36:42 -0000 Delivered-To: joseph86@example.com Received: (qmail 49419 invoked by uid 500); 2 Oct 2006 09:36:42 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 49408 invoked by uid 99); 2 Oct 2006 09:36:42 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 02:36:42 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [83.161.120.155] ([83.161.120.155:60799] helo=moutng.kundenserver.de) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id 3F/93-16499-7ADD0254 for <joseph86@example.com>; Mon, 02 Oct 2006 02:36:41 -0700 Received: from [83.161.120.155] (helo=[83.161.120.155]) by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis), id 0ML25U-1GUKE02KJJ-0007gk; Mon, 02 Oct 2006 11:36:36 +0200 Message-ID: <joseph86@example.com> Date: Mon, 02 Oct 2006 11:39:21 +0200 From: Roland Weber <joseph86@example.com> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060428 X-Accept-Language: en-us, en MIME-Version: 1.0 To: HttpClient User Discussion <joseph86@example.com> Subject: Re: Entity Enclosing Requests References: <joseph86@example.com> In-Reply-To: <joseph86@example.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de joseph86@example.com login:4601b1d39ab4ddfc21c613822e406392 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello Melvin, > The question is can I just simply reuse the last half > of PostMethod in LoginDemo (modified) and just adding > new NameValuePair variables? Do I have to modify > anything substantially? That totally depends on the server application. You should first try to make it as simple as possible. If that doesn't work, the primer explains how to proceed: http://wiki.apache.org/jakarta-httpclient/ForAbsoluteBeginners cheers, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com From httpclient-user-returnjoseph86@example.com Mon Oct 02 14:08:27 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 72428 invoked from network); 2 Oct 2006 14:08:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 14:08:26 -0000 Received: (qmail 27301 invoked by uid 500); 2 Oct 2006 14:08:26 -0000 Delivered-To: joseph86@example.com Received: (qmail 27286 invoked by uid 500); 2 Oct 2006 14:08:25 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 27275 invoked by uid 99); 2 Oct 2006 14:08:25 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 07:08:25 -0700 X-ASF-Spam-Status: No, hits=1.0 required=5.0 tests=URI_NOVOWEL Received: from [83.161.120.155] ([83.161.120.155:41085] helo=mail.weycogroup.com) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id C3/0B-16499-54D11254 for <joseph86@example.com>; Mon, 02 Oct 2006 07:08:12 -0700 Received: from localhost (localhost [83.161.120.155]) by mail.weycogroup.com (Postfix) with ESMTP id 68F41D4B56 for <joseph86@example.com>; Mon, 2 Oct 2006 09:05:35 -0500 (CDT) From: Glenn Holmer <joseph86@example.com> Organization: Weyco Group, Inc. To: joseph86@example.com Subject: ProtocolException question Date: Mon, 2 Oct 2006 09:07:04 -0500 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <joseph86@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I'm writing code to connect to an SSL server. Although I can see the responses I'm expecting in the wire trace, the program still fails on a ProtocolException (when I call client.executeMethod() with a PostMethod). I've tried several adjustments: client = new HttpClient(); client.getParams().setParameter( "http.protocol.version", HttpVersion.HTTP_1_0); client.getParams().setParameter( "http.protocol.content-charset", "UTF-8"); client.getParams().setParameter( "http.protocol.unambiguous-statusline", false); client.getParams().setParameter( "http.protocol.strict-transfer-encoding", false); client.getParams().setParameter( "http.protocol.status-line-garbage-limit", Integer.MAX_VALUE); Is there anything obvious I might have missed? This is the stack trace: org.apache.commons.httpclient.ProtocolException: The server xxxxxxxx.xxxxxxxx.com failed to respond with a valid HTTP joseph86@example.com(HttpMethodBase.java:1846) at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324) -- ____________________________________________________________ Glenn Holmer joseph86@example.com Software Engineer phone: (678)638-9749 Weyco Group, Inc. fax: (678)638-9749 --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com From httpclient-user-returnjoseph86@example.com Mon Oct 02 14:28:19 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 81885 invoked from network); 2 Oct 2006 14:28:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 14:28:18 -0000 Received: (qmail 64289 invoked by uid 500); 2 Oct 2006 14:28:18 -0000 Delivered-To: joseph86@example.com Received: (qmail 64281 invoked by uid 500); 2 Oct 2006 14:28:17 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 64269 invoked by uid 99); 2 Oct 2006 14:28:17 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 07:28:17 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [83.161.120.155] ([83.161.120.155:50713] helo=moutng.kundenserver.de) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id 68/5B-16499-6E121254 for <joseph86@example.com>; Mon, 02 Oct 2006 07:27:53 -0700 Received: from [83.161.120.155] (helo=[83.161.120.155]) by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis), id 0MKwh2-1GUOl42su0-00010A; Mon, 02 Oct 2006 16:27:03 +0200 Message-ID: <joseph86@example.com> Date: Mon, 02 Oct 2006 16:29:40 +0200 From: Roland Weber <joseph86@example.com> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060428 X-Accept-Language: en-us, en MIME-Version: 1.0 To: HttpClient User Discussion <joseph86@example.com> Subject: Re: ProtocolException question References: <joseph86@example.com> In-Reply-To: <joseph86@example.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de joseph86@example.com login:4601b1d39ab4ddfc21c613822e406392 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello Glenn, please send a context/wire log of the failing request. Since you get some requests through without problems, it doesn't seem to be one of the usual mistakes. cheers, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com From httpclient-user-returnjoseph86@example.com Mon Oct 02 14:32:30 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 83627 invoked from network); 2 Oct 2006 14:32:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 14:32:29 -0000 Received: (qmail 70958 invoked by uid 500); 2 Oct 2006 14:32:27 -0000 Delivered-To: joseph86@example.com Received: (qmail 70847 invoked by uid 500); 2 Oct 2006 14:32:26 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 70679 invoked by uid 99); 2 Oct 2006 14:32:25 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 07:32:25 -0700 X-ASF-Spam-Status: No, hits=1.0 required=5.0 tests=URI_NOVOWEL Received: from [83.161.120.155] ([83.161.120.155:3488] helo=c2kp01smtp.cucbc.com) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id 8B/6B-16499-BD221254 for <joseph86@example.com>; Mon, 02 Oct 2006 07:32:08 -0700 Received: from c2kp01mail.cucbc.com ([83.161.120.155]) by c2kp01smtp.cucbc.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 2 Oct 2006 07:31:50 -0700 Received: from [83.161.120.155] ([83.161.120.155]) by c2kp01mail.cucbc.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 2 Oct 2006 07:31:19 -0700 Subject: Re: ProtocolException question From: Julius Davies <joseph86@example.com> Reply-To: joseph86@example.com To: HttpClient User Discussion <joseph86@example.com> In-Reply-To: <joseph86@example.com> References: <joseph86@example.com> Content-Type: text/plain Organization: Credit Union Central of British Columbia Date: Mon, 02 Oct 2006 07:31:18 -0700 Message-Id: <joseph86@example.com> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 02 Oct 2006 14:31:19.0998 (UTC) FILETIME=[6D675DE0:01C6E62F] X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, Is your server responding with the very important HTTP status line? It looks like this: HTTP/1.1 200 OK Try telnetting in and performing the same HTTP request. If you're connecting to an SSL server you'll probably need to use openssl's "s_client" command. openssl s_client -connect www.cucbc.com:443 After all the certificate and SSL information flies by on the screen, type in something like this: HEAD / HTTP/1.0[enter] [enter] Replace "www.cucbc.com" with whatever server you are connecting to. Replace "/" with the path of the resource you are requesting. You should hopefully see a response like this: HTTP/1.1 200 OK Date: Mon, 02 Oct 2006 14:22:02 GMT Server: Apache/2.0.46 (Red Hat) Accept-Ranges: bytes Connection: close Content-Type: text/html; charset=UTF-8 If you are on Windows you can download OpenSSL starting from this link: http://www.openssl.org/related/binaries.html Instead of the openssl "s_client" command, you could try this pure-java "commons-ssl" Ping utility I'm working on instead, but it only does "HEAD /" - it doesn't try any other URL's. You'd need to hack it up a bit to get different URLs. http://juliusdavies.ca/commons-ssl/ Download "commons-ssl.jar" or "commons-ssl.zip", and once you have a jar file, try this: java -jar commons-ssl.jar Hopefully that will show whether your server is correctly responding with a status line! yours, Julius On Mon, 2006-02-10 at 09:07 -0500, Glenn Holmer wrote: > I'm writing code to connect to an SSL server. Although I can see the > responses I'm expecting in the wire trace, the program still fails on a > ProtocolException (when I call client.executeMethod() with a > PostMethod). I've tried several adjustments: > > client = new HttpClient(); > client.getParams().setParameter( > "http.protocol.version", > HttpVersion.HTTP_1_0); > client.getParams().setParameter( > "http.protocol.content-charset", > "UTF-8"); > client.getParams().setParameter( > "http.protocol.unambiguous-statusline", > false); > client.getParams().setParameter( > "http.protocol.strict-transfer-encoding", > false); > client.getParams().setParameter( > "http.protocol.status-line-garbage-limit", > Integer.MAX_VALUE); > > Is there anything obvious I might have missed? This is the stack trace: > > org.apache.commons.httpclient.ProtocolException: The server > xxxxxxxx.xxxxxxxx.com failed to respond with a valid HTTP response > at > org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1846) > at > org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590) > at > org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995) > at > org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397) > at > org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) > at > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) > at > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324) > -- Julius Davies Senior Application Developer, Technology Services Credit Union Central of British Columbia http://www.cucbc.com/ Tel: (678)638-9749 Cel: (678)638-9749 1441 Creekside Drive Vancouver, BC Canada V6J 4S7 --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com From httpclient-user-returnjoseph86@example.com Mon Oct 02 14:54:55 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 94284 invoked from network); 2 Oct 2006 14:54:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 14:54:55 -0000 Received: (qmail 2043 invoked by uid 500); 2 Oct 2006 14:54:54 -0000 Delivered-To: joseph86@example.com Received: (qmail 1778 invoked by uid 500); 2 Oct 2006 14:54:54 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 1767 invoked by uid 99); 2 Oct 2006 14:54:53 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 07:54:53 -0700 X-ASF-Spam-Status: No, hits=1.0 required=5.0 tests=URI_NOVOWEL Received: from [83.161.120.155] ([83.161.120.155:41360] helo=mail.weycogroup.com) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id 78/DB-16499-02821254 for <joseph86@example.com>; Mon, 02 Oct 2006 07:54:26 -0700 Received: from localhost (localhost [83.161.120.155]) by mail.weycogroup.com (Postfix) with ESMTP id 62823CE785 for <joseph86@example.com>; Mon, 2 Oct 2006 09:52:10 -0500 (CDT) From: Glenn Holmer <joseph86@example.com> Organization: Weyco Group, Inc. To: "HttpClient User Discussion" <joseph86@example.com> Subject: Re: ProtocolException question Date: Mon, 2 Oct 2006 09:53:39 -0500 User-Agent: KMail/1.9.1 References: <joseph86@example.com> <joseph86@example.com> In-Reply-To: <joseph86@example.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <joseph86@example.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Monday 02 October 2006 09:29, Roland Weber wrote: > please send a context/wire log of the failing request. > Since you get some requests through without problems, > it doesn't seem to be one of the usual mistakes. I've had to redact some of this because of an NDA. Where it says "DATA REMOVED" are the params I'm sending, in the form "0=xxx,1=xxx,...". 2006-10-02 09:33:39 DEBUG PostMethod setRequestBody:402 enter PostMethod.setRequestBody(NameValuePair[]) 2006-10-02 09:33:39 DEBUG PostMethod clearRequestBody:151 enter PostMethod.clearRequestBody() 2006-10-02 09:33:39 DEBUG EntityEnclosingMethod clearRequestBody:149 enter EntityEnclosingMethod.clearRequestBody() 2006-10-02 09:33:39 DEBUG PostMethod addParameters:303 enter PostMethod.addParameters(NameValuePair[]) 2006-10-02 09:33:39 DEBUG EntityEnclosingMethod clearRequestBody:149 enter EntityEnclosingMethod.clearRequestBody() 2006-10-02 09:33:39 DEBUG HttpClient executeMethod:322 enter HttpClient.executeMethod(HttpMethod) 2006-10-02 09:33:39 DEBUG HttpClient executeMethod:373 enter HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState) 2006-10-02 09:33:39 DEBUG HttpMethodDirector executeWithRetry:378 Attempt number 1 to process request 2006-10-02 09:33:39 DEBUG HttpConnection open:684 enter HttpConnection.open() 2006-10-02 09:33:39 DEBUG HttpConnection open:691 Open connection to xxxxxxxx.xxxxxxxx.com:443 2006-10-02 09:33:40 DEBUG HttpMethodBase execute:976 enter HttpMethodBase.execute(HttpState, HttpConnection) 2006-10-02 09:33:40 DEBUG HttpMethodBase writeRequest:1916 enter HttpMethodBase.writeRequest(HttpState, HttpConnection) 2006-10-02 09:33:40 DEBUG HttpMethodBase writeRequestLine:2071 enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection) 2006-10-02 09:33:40 DEBUG HttpMethodBase generateRequestLine:1379 enter HttpMethodBase.generateRequestLine(HttpConnection, String, String, String, String) 2006-10-02 09:33:40 DEBUG header wire:69 >> "POST /xxxxxxx/xxxxxxx.cgi HTTP/1.1[\r][\n]" 2006-10-02 09:33:40 DEBUG HttpConnection print:1031 enter HttpConnection.print(String) 2006-10-02 09:33:40 DEBUG HttpConnection write:941 enter HttpConnection.write(byte[]) 2006-10-02 09:33:40 DEBUG HttpConnection write:962 enter HttpConnection.write(byte[], int, int) 2006-10-02 09:33:40 DEBUG HttpMethodBase writeRequestHeaders:2034 enter HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection) 2006-10-02 09:33:40 DEBUG EntityEnclosingMethod addRequestHeaders:366 enter EntityEnclosingMethod.addRequestHeaders(HttpState, HttpConnection) 2006-10-02 09:33:40 DEBUG ExpectContinueMethod addRequestHeaders:182 enter ExpectContinueMethod.addRequestHeaders(HttpState, HttpConnection) 2006-10-02 09:33:40 DEBUG HttpMethodBase addRequestHeaders:1300 enter HttpMethodBase.addRequestHeaders(HttpState, HttpConnection) 2006-10-02 09:33:40 DEBUG HttpMethodBase addUserAgentRequestHeader:1325 enter HttpMethodBase.addUserAgentRequestHeaders(HttpState, HttpConnection) 2006-10-02 09:33:40 DEBUG HttpMethodBase addHostRequestHeader:1211 enter HttpMethodBase.addHostRequestHeader(HttpState, HttpConnection) 2006-10-02 09:33:40 DEBUG HttpMethodBase addHostRequestHeader:1235 Adding Host request header 2006-10-02 09:33:40 DEBUG HttpMethodBase addCookieRequestHeader:1163 enter HttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection) 2006-10-02 09:33:40 DEBUG HttpState getCookies:172 enter HttpState.getCookies() 2006-10-02 09:33:40 DEBUG CookieSpec match:548 enter CookieSpecBase.match(String, int, String, boolean, Cookie[]) 2006-10-02 09:33:40 DEBUG HttpMethodBase addProxyConnectionHeader:1262 enter HttpMethodBase.addProxyConnectionHeader(HttpState, HttpConnection) 2006-10-02 09:33:40 DEBUG EntityEnclosingMethod addContentLengthRequestHeader:397 enter EntityEnclosingMethod.addContentLengthRequestHeader(HttpState, HttpConnection) 2006-10-02 09:33:40 DEBUG EntityEnclosingMethod getRequestContentLength:321 enter EntityEnclosingMethod.getRequestContentLength() 2006-10-02 09:33:40 DEBUG PostMethod hasRequestContent:134 enter PostMethod.hasRequestContent() 2006-10-02 09:33:40 DEBUG PostMethod getParameters:239 enter PostMethod.getParameters() 2006-10-02 09:33:40 DEBUG HttpMethodBase getContentCharSet:2183 enter getContentCharSet( Header contentheader ) 2006-10-02 09:33:40 DEBUG HttpMethodBase getContentCharSet:2201 Default charset used: UTF-8 2006-10-02 09:33:40 DEBUG HttpMethodBase addRequestHeader:382 HttpMethodBase.addRequestHeader(Header) 2006-10-02 09:33:40 DEBUG PostMethod getParameters:239 enter PostMethod.getParameters() 2006-10-02 09:33:40 DEBUG HttpMethodBase getContentCharSet:2183 enter getContentCharSet( Header contentheader ) 2006-10-02 09:33:40 DEBUG HeaderElement parseElements:237 enter HeaderElement.parseElements(String) 2006-10-02 09:33:40 DEBUG HeaderElement parseElements:193 enter HeaderElement.parseElements(char[]) 2006-10-02 09:33:40 DEBUG HeaderElement getParameterByName:278 enter HeaderElement.getParameterByName(String) 2006-10-02 09:33:40 DEBUG HttpMethodBase getContentCharSet:2201 Default charset used: UTF-8 2006-10-02 09:33:40 DEBUG header wire:69 >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]" 2006-10-02 09:33:40 DEBUG HttpConnection print:1031 enter HttpConnection.print(String) 2006-10-02 09:33:40 DEBUG HttpConnection write:941 enter HttpConnection.write(byte[]) 2006-10-02 09:33:40 DEBUG HttpConnection write:962 enter HttpConnection.write(byte[], int, int) 2006-10-02 09:33:40 DEBUG header wire:69 >> "Host: xxxxxxxx.xxxxxxxx.com[\r][\n]" 2006-10-02 09:33:40 DEBUG HttpConnection print:1031 enter HttpConnection.print(String) 2006-10-02 09:33:40 DEBUG HttpConnection write:941 enter HttpConnection.write(byte[]) 2006-10-02 09:33:40 DEBUG HttpConnection write:962 enter HttpConnection.write(byte[], int, int) 2006-10-02 09:33:40 DEBUG header wire:69 >> "Content-Length: 597[\r] [\n]" 2006-10-02 09:33:40 DEBUG HttpConnection print:1031 enter HttpConnection.print(String) 2006-10-02 09:33:40 DEBUG HttpConnection write:941 enter HttpConnection.write(byte[]) 2006-10-02 09:33:40 DEBUG HttpConnection write:962 enter HttpConnection.write(byte[], int, int) 2006-10-02 09:33:40 DEBUG header wire:69 >> "Content-Type: application/x-www-form-urlencoded[\r][\n]" 2006-10-02 09:33:40 DEBUG HttpConnection print:1031 enter HttpConnection.print(String) 2006-10-02 09:33:40 DEBUG HttpConnection write:941 enter HttpConnection.write(byte[]) 2006-10-02 09:33:40 DEBUG HttpConnection write:962 enter HttpConnection.write(byte[], int, int) 2006-10-02 09:33:40 DEBUG HttpConnection writeLine:1000 enter HttpConnection.writeLine() 2006-10-02 09:33:40 DEBUG HttpConnection write:941 enter HttpConnection.write(byte[]) 2006-10-02 09:33:40 DEBUG HttpConnection write:962 enter HttpConnection.write(byte[], int, int) 2006-10-02 09:33:40 DEBUG header wire:69 >> "[\r][\n]" 2006-10-02 09:33:40 DEBUG EntityEnclosingMethod writeRequestBody:465 enter EntityEnclosingMethod.writeRequestBody(HttpState, HttpConnection) 2006-10-02 09:33:40 DEBUG PostMethod hasRequestContent:134 enter PostMethod.hasRequestContent() 2006-10-02 09:33:40 DEBUG EntityEnclosingMethod getRequestContentLength:321 enter EntityEnclosingMethod.getRequestContentLength() 2006-10-02 09:33:40 DEBUG PostMethod hasRequestContent:134 enter PostMethod.hasRequestContent() 2006-10-02 09:33:40 DEBUG HttpConnection getRequestOutputStream:839 enter HttpConnection.getRequestOutputStream() 2006-10-02 09:33:40 DEBUG content wire:83 >> *** DATA REMOVED *** 2006-10-02 09:33:40 DEBUG EntityEnclosingMethod writeRequestBody:504 Request body sent 2006-10-02 09:33:40 DEBUG HttpConnection flushRequestOutputStream:825 enter HttpConnection.flushRequestOutputStream() 2006-10-02 09:33:40 DEBUG HttpMethodBase readResponse:1585 enter HttpMethodBase.readResponse(HttpState, HttpConnection) 2006-10-02 09:33:40 DEBUG HttpMethodBase readStatusLine:1823 enter HttpMethodBase.readStatusLine(HttpState, HttpConnection) 2006-10-02 09:33:40 DEBUG HttpConnection readLine:1112 enter HttpConnection.readLine() 2006-10-02 09:33:41 DEBUG HttpParser readLine:104 enter HttpParser.readLine(InputStream, String) 2006-10-02 09:33:41 DEBUG HttpParser readRawLine:73 enter HttpParser.readRawLine() 2006-10-02 09:33:41 DEBUG header wire:69 << "XXXXXXXXXXXXXXXXXXX=XX[\r] [\n]" 2006-10-02 09:33:41 DEBUG HttpConnection readLine:1112 enter HttpConnection.readLine() 2006-10-02 09:33:41 DEBUG HttpParser readLine:104 enter HttpParser.readLine(InputStream, String) 2006-10-02 09:33:41 DEBUG HttpParser readRawLine:73 enter HttpParser.readRawLine() 2006-10-02 09:33:41 DEBUG header wire:69 << "XXXXXXXXXXXXXXXXX=X[\r] [\n]" (several more similar responses) 2006-10-02 09:33:41 DEBUG HttpConnection readLine:1112 enter HttpConnection.readLine() 2006-10-02 09:33:41 DEBUG HttpParser readLine:104 enter HttpParser.readLine(InputStream, String) 2006-10-02 09:33:41 DEBUG HttpParser readRawLine:73 enter HttpParser.readRawLine() 2006-10-02 09:33:41 DEBUG header wire:69 << "null[\r][\n]" 2006-10-02 09:33:41 DEBUG HttpMethodDirector executeWithRetry:449 Closing the connection. 2006-10-02 09:33:41 DEBUG HttpConnection close:1147 enter HttpConnection.close() org.apache.commons.httpclient.ProtocolException: The server xxxxxxxx.xxxxxxxx.com failed to respond with a valid HTTP joseph86@example.com(HttpMethodBase.java:1846) -- ____________________________________________________________ Glenn Holmer joseph86@example.com Software Engineer phone: (678)638-9749 Weyco Group, Inc. fax: (678)638-9749 --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com From httpclient-user-returnjoseph86@example.com Mon Oct 02 14:58:17 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 96208 invoked from network); 2 Oct 2006 14:58:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 14:58:17 -0000 Received: (qmail 8563 invoked by uid 500); 2 Oct 2006 14:58:17 -0000 Delivered-To: joseph86@example.com Received: (qmail 8379 invoked by uid 500); 2 Oct 2006 14:58:15 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 8368 invoked by uid 99); 2 Oct 2006 14:58:15 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 07:58:15 -0700 Authentication-Results: idunn.apache.osuosl.org joseph86@example.com; domainkeys=good X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 Received: from [83.161.120.155] ([83.161.120.155:37200] helo=web60717.mail.yahoo.com) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id F4/EB-16499-CD821254 for <joseph86@example.com>; Mon, 02 Oct 2006 07:57:34 -0700 Received: (qmail 97933 invoked by uid 60001); 2 Oct 2006 14:57:11 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=UlORN1Ywbppx56yc1rnbf0mjtlIfg/Pb/SvH8pz1Ce3eDqI0nFd7Z2pXJm45tHca8ikXfVUkY3ObaDUGKWgBAQJCKnY89U3fXeDixyf6LUi1rro/7zDjWYuMGf8r0/UTfOCFiSRaT0fzeFibLm+blQ2uiIPzaEdWSUw4qd1Yjkk= ; Message-ID: <joseph86@example.com> Received: from [83.161.120.155] by web60717.mail.yahoo.com via HTTP; Mon, 02 Oct 2006 07:57:11 PDT Date: Mon, 2 Oct 2006 07:57:11 -0700 (PDT) From: wilson wong <joseph86@example.com> Subject: httpclient and siteminder To: joseph86@example.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi All New to this group, I apologize if the following questions have been asked before. Try to use HTTPClient to connect to a WebServer(https) that is protected by Siteminder 1. From a standalone JAVA program. String url = "https://www.foo.com/apps?showme.do?id=12345"; HttpClient hc = new HttpClient(); Credentials defaultcreds = new UsernamePasswordCredentials("username", "password"); hc.getState().setCredentials(new AuthScope("https://www.foo.com/apps", 443), defaultcreds); try { PostMethod post = new PostMethod(url); I nt rc = hc.executeMethod(post); System.out.println("------ RC = " + rc); System.out.println( post.getResponseBodyAsString()); } catch (Exception e) { System.out.println("---- e --" + e.getMessage()); e.printStackTrace(); } I keep getting "401" return code/ Here is the runtime result: Please note that the actual url has been replaced with www.foo.com DEBUG 10:17:20 HttpClient - Java version: 1.4.1_03 DEBUG 10:17:20 HttpClient - Java vendor: Sun Microsystems Inc. DEBUG 10:17:20 HttpClient - Java class path: ...... DEBUG 10:17:20 HttpClient - Operating system name: Windows XP DEBUG 10:17:20 HttpClient - Operating system architecture: x86 DEBUG 10:17:20 HttpClient - Operating system version: 5.1 DEBUG 10:17:20 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) DEBUG 10:17:20 HttpClient - SunJSSE 1.41: Sun JSSE provider(implements RSA Signatures, PKCS12, SunX509 key/trust factories, SSLv3, TLSv1) DEBUG 10:17:20 HttpClient - SunRsaSign 1.0: SUN's provider for RSA signatures DEBUG 10:17:20 HttpClient - SunJCE 1.4: SunJCE Provider (implements DES, Triple DES, Blowfish, PBE, Diffie-Hellman, HMAC-MD5, HMAC-SHA1) DEBUG 10:17:20 HttpClient - SunJGSS 1.0: Sun (Kerberos v5) DEBUG 10:17:20 DefaultHttpParams - Set parameter http.useragent = Jakarta Commons-HttpClient/3.0 DEBUG 10:17:20 DefaultHttpParams - Set parameter http.protocol.version = HTTP/1.1 DEBUG 10:17:20 DefaultHttpParams - Set parameter http.connection-manager.class = class org.apache.commons.httpclient.SimpleHttpConnectionManager DEBUG 10:17:20 DefaultHttpParams - Set parameter http.protocol.cookie-policy = rfc2109 DEBUG 10:17:20 DefaultHttpParams - Set parameter http.protocol.element-charset = US-ASCII DEBUG 10:17:20 DefaultHttpParams - Set parameter http.protocol.content-charset = ISO-8859-1 DEBUG 10:17:20 DefaultHttpParams - Set parameter http.method.retry-handler = org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@18f51f DEBUG 10:17:20 DefaultHttpParams - Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z] DEBUG 10:17:22 HttpState - enter HttpState.setCredentials(AuthScope, Credentials) DEBUG 10:17:25 HttpMethodBase - HttpMethodBase.addRequestHeader(Header) DEBUG 10:17:26 HttpMethodBase - HttpMethodBase.addRequestHeader(Header) DEBUG 10:17:26 HttpMethodBase - HttpMethodBase.addRequestHeader(Header) DEBUG 10:17:28 EntityEnclosingMethod - enter EntityEnclosingMethod.setRequestBody(InputStream) DEBUG 10:17:28 PostMethod - enter PostMethod.clearRequestBody() DEBUG 10:17:28 EntityEnclosingMethod - enter EntityEnclosingMethod.clearRequestBody() DEBUG 10:17:29 HttpClient - enter HttpClient.executeMethod(HttpMethod) DEBUG 10:17:29 HttpClient - enter HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState) DEBUG 10:17:29 HttpMethodDirector - Attempt number 1 to process request DEBUG 10:17:29 HttpConnection - enter HttpConnection.open() DEBUG 10:17:29 HttpConnection - Open connection to www.foo.com:443 <www.foo.com:443> DEBUG 10:17:29 HttpMethodBase - enter HttpMethodBase.execute(HttpState, HttpConnection) DEBUG 10:17:29 HttpMethodBase - enter HttpMethodBase.writeRequest(HttpState, HttpConnection) DEBUG 10:17:29 HttpMethodBase - enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection) DEBUG 10:17:29 HttpMethodBase - enter HttpMethodBase.generateRequestLine(HttpConnection, String, String, String, String) DEBUG 10:17:29 Wire - >> "POST /apps?showme.do?id=12345 HTTP/1.1[\r][\n]" DEBUG 10:17:29 HttpConnection - enter HttpConnection.print(String) DEBUG 10:17:29 HttpConnection - enter HttpConnection.write(byte[]) DEBUG 10:17:29 HttpConnection - enter HttpConnection.write(byte[], int, int) DEBUG 10:17:29 HttpMethodBase - enter HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection) DEBUG 10:17:29 EntityEnclosingMethod - enter EntityEnclosingMethod.addRequestHeaders(HttpState, HttpConnection) DEBUG 10:17:29 ExpectContinueMethod - enter ExpectContinueMethod.addRequestHeaders(HttpState, HttpConnection) DEBUG 10:17:29 HttpMethodBase - enter HttpMethodBase.addRequestHeaders(HttpState, HttpConnection) DEBUG 10:17:29 HttpMethodBase - enter HttpMethodBase.addUserAgentRequestHeaders(HttpState, HttpConnection) DEBUG 10:17:29 HttpMethodBase - enter HttpMethodBase.addHostRequestHeader(HttpState, HttpConnection) DEBUG 10:17:29 HttpMethodBase - Adding Host request header DEBUG 10:17:29 HttpMethodBase - enter HttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection) DEBUG 10:17:29 HttpState - enter HttpState.getCookies() DEBUG 10:17:29 CookieSpecBase - enter CookieSpecBase.match(String, int, String, boolean, Cookie[]) DEBUG 10:17:29 HttpMethodBase - enter HttpMethodBase.addProxyConnectionHeader(HttpState, HttpConnection) DEBUG 10:17:29 EntityEnclosingMethod - enter EntityEnclosingMethod.addContentLengthRequestHeader(HttpState, HttpConnection) DEBUG 10:17:29 Wire - >> "Connection: Keep-Alive[\r][\n]" DEBUG 10:17:29 HttpConnection - enter HttpConnection.print(String) DEBUG 10:17:29 HttpConnection - enter HttpConnection.write(byte[]) DEBUG 10:17:29 HttpConnection - enter HttpConnection.write(byte[], int, int) DEBUG 10:17:29 Wire - >> "Content-Length: 5[\r][\n]" DEBUG 10:17:29 HttpConnection - enter HttpConnection.print(String) DEBUG 10:17:29 HttpConnection - enter HttpConnection.write(byte[]) DEBUG 10:17:29 HttpConnection - enter HttpConnection.write(byte[], int, int) DEBUG 10:17:29 Wire - >> "Content-Type: text/xml;charset=utf-8[\r][\n]" DEBUG 10:17:29 HttpConnection - enter HttpConnection.print(String) DEBUG 10:17:29 HttpConnection - enter HttpConnection.write(byte[]) DEBUG 10:17:29 HttpConnection - enter HttpConnection.write(byte[], int, int) DEBUG 10:17:29 Wire - >> "User-Agent: Jakarta Commons-HttpClient/3.0[\r][\n]" DEBUG 10:17:29 HttpConnection - enter HttpConnection.print(String) DEBUG 10:17:29 HttpConnection - enter HttpConnection.write(byte[]) DEBUG 10:17:29 HttpConnection - enter HttpConnection.write(byte[], int, int) DEBUG 10:17:29 Wire - >> "Host: www.foo.com[\r][\n <www.foo.com[\r][\n> ]" DEBUG 10:17:29 HttpConnection - enter HttpConnection.print(String) DEBUG 10:17:29 HttpConnection - enter HttpConnection.write(byte[]) DEBUG 10:17:29 HttpConnection - enter HttpConnection.write(byte[], int, int) DEBUG 10:17:29 HttpConnection - enter HttpConnection.writeLine() DEBUG 10:17:29 HttpConnection - enter HttpConnection.write(byte[]) DEBUG 10:17:29 HttpConnection - enter HttpConnection.write(byte[], int, int) DEBUG 10:17:29 Wire - >> "[\r][\n]" DEBUG 10:17:29 EntityEnclosingMethod - enter EntityEnclosingMethod.writeRequestBody(HttpState, HttpConnection) DEBUG 10:17:29 PostMethod - enter PostMethod.hasRequestContent() DEBUG 10:17:29 EntityEnclosingMethod - enter EntityEnclosingMethod.hasRequestContent() DEBUG 10:17:29 EntityEnclosingMethod - enter EntityEnclosingMethod.renerateRequestBody() DEBUG 10:17:29 EntityEnclosingMethod - enter EntityEnclosingMethod.getRequestContentLength() DEBUG 10:17:29 PostMethod - enter PostMethod.hasRequestContent() DEBUG 10:17:29 EntityEnclosingMethod - enter EntityEnclosingMethod.hasRequestContent() DEBUG 10:17:29 HttpConnection - enter HttpConnection.getRequestOutputStream() DEBUG 10:17:29 Wire - >> "hello" DEBUG 10:17:30 EntityEnclosingMethod - Request body sent DEBUG 10:17:30 HttpConnection - enter HttpConnection.flushRequestOutputStream() DEBUG 10:17:30 HttpMethodBase - enter HttpMethodBase.readResponse(HttpState, HttpConnection) DEBUG 10:17:30 HttpMethodBase - enter HttpMethodBase.readStatusLine(HttpState, HttpConnection) DEBUG 10:17:30 HttpConnection - enter HttpConnection.readLine() DEBUG 10:17:30 HttpParser - enter HttpParser.readLine(InputStream, String) DEBUG 10:17:30 HttpParser - enter HttpParser.readRawLine() DEBUG 10:17:30 Wire - << "HTTP/1.1 401 401: Access Denied[\r][\n]" DEBUG 10:17:30 HttpMethodBase - enter HttpMethodBase.readResponseHeaders(HttpState,HttpConnection) DEBUG 10:17:30 HttpConnection - enter HttpConnection.getResponseInputStream() DEBUG 10:17:30 HttpParser - enter HeaderParser.parseHeaders(InputStream, String) DEBUG 10:17:30 HttpParser - enter HttpParser.readLine(InputStream, String) DEBUG 10:17:30 HttpParser - enter HttpParser.readRawLine() DEBUG 10:17:30 HttpParser - enter HttpParser.readLine(InputStream, String) DEBUG 10:17:30 HttpParser - enter HttpParser.readRawLine() DEBUG 10:17:30 HttpParser - enter HttpParser.readLine(InputStream, String) DEBUG 10:17:30 HttpParser - enter HttpParser.readRawLine() DEBUG 10:17:30 HttpParser - enter HttpParser.readLine(InputStream, String) DEBUG 10:17:30 HttpParser - enter HttpParser.readRawLine() DEBUG 10:17:30 HttpParser - enter HttpParser.readLine(InputStream, String) DEBUG 10:17:30 HttpParser - enter HttpParser.readRawLine() DEBUG 10:17:30 HttpParser - enter HttpParser.readLine(InputStream, String) DEBUG 10:17:30 HttpParser - enter HttpParser.readRawLine() DEBUG 10:17:30 HttpParser - enter HttpParser.readLine(InputStream, String) DEBUG 10:17:30 HttpParser - enter HttpParser.readRawLine() DEBUG 10:17:30 HttpParser - enter HttpParser.readLine(InputStream, String) DEBUG 10:17:30 HttpParser - enter HttpParser.readRawLine() DEBUG 10:17:30 Wire - << "Date: Mon, 02 Oct 2006 14:17:29 GMT[\r][\n]" DEBUG 10:17:30 Wire - << "Content-Type: text/html[\r][\n]" DEBUG 10:17:30 Wire - << "Connection: close[\r][\n]" DEBUG 10:17:30 Wire - << "Server: Netscape-Enterprise/6.0[\r][\n]" DEBUG 10:17:30 Wire - << "WWW-authenticate: basic realm="WWW.FOO.COM/apps - Enter AKO Username and Password [09:17:30:2551]"[\r][\n]" DEBUG 10:17:30 Wire - << "Set-Cookie: SMCHALLENGE=YES; path=/; domain=.foo.com[\r][\n]" DEBUG 10:17:30 Wire - << "Via: 1.1 ROC-CTNOSC (NetCache NetApp/6.0.3P2)[\r][\n]" DEBUG 10:17:30 HttpMethodBase - enter HttpMethodBase.processResponseHeaders(HttpState, HttpConnection) DEBUG 10:17:30 CookieSpecBase - enter CookieSpecBase.parse(String, port, path, boolean, String) DEBUG 10:17:30 CookieSpecBase - enter CookieSpecBase.parse(String, port, path, boolean, Header) DEBUG 10:17:30 HeaderElement - enter HeaderElement.parseElements(char[]) DEBUG 10:17:31 Cookie - enter Cookie(String, String, String, String, Date, boolean) DEBUG 10:17:31 RFC2109Spec - enter RFC2109Spec.validate(String, int, String, boolean, Cookie) DEBUG 10:17:31 CookieSpecBase - enter CookieSpecBase.validate(String, port, path, boolean, Cookie) DEBUG 10:17:31 HttpState - enter HttpState.addCookie(Cookie) DEBUG 10:17:31 RFC2109Spec - enter RFC2109Spec.formatCookie(Cookie) DEBUG 10:17:31 HttpMethodBase - Cookie accepted: "$Version=0; SMCHALLENGE=YES; $Path=/; $Domain=.foo.mil" DEBUG 10:17:31 HttpMethodBase - enter HttpMethodBase.readResponseBody(HttpState, HttpConnection) DEBUG 10:17:31 HttpMethodBase - enter HttpMethodBase.readResponseBody(HttpConnection) DEBUG 10:17:31 HttpConnection - enter HttpConnection.getResponseInputStream() DEBUG 10:17:31 HttpMethodBase - enter HttpMethodBase.canResponseHaveBody(int) DEBUG 10:17:31 HttpMethodDirector - Authorization required DEBUG 10:17:31 HttpMethodDirector - enter HttpMethodBase.processAuthenticationResponse(HttpState, HttpConnection) DEBUG 10:17:31 AuthChallengeProcessor - Supported authentication schemes in the order of preference: [ntlm, digest, basic] DEBUG 10:17:31 AuthChallengeProcessor - Challenge for ntlm authentication scheme not available DEBUG 10:17:31 AuthChallengeProcessor - Challenge for digest authentication scheme not available INFO 10:17:31 AuthChallengeProcessor - basic authentication scheme selected DEBUG 10:17:31 AuthChallengeProcessor - Using authentication scheme: basic DEBUG 10:17:31 AuthChallengeProcessor - Authorization challenge processed DEBUG 10:17:31 HttpMethodDirector - Authentication scope: BASIC 'WWW.FOO.COM/apps <WWW.FOO.COM/apps> - Enter AKO Username and Password [09:17:30:2551]'@www.foo.com:443 DEBUG 10:17:31 HttpState - enter HttpState.getCredentials(AuthScope) DEBUG 10:17:31 HttpMethodDirector - Credentials required DEBUG 10:17:31 HttpMethodDirector - Credentials provider not available INFO 10:17:31 HttpMethodDirector - No credentials available for BASIC 'WWW>FOO>COM/apps - Enter AKO Username and Password [09:17:30:2551]'@www.foo.com:443 ------ RC = 401 WARN 10:17:35 HttpMethodBase - Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended. DEBUG 10:17:35 HttpMethodBase - Buffering response body DEBUG 10:17:35 Wire - << "<HTML><HEAD><TITLE>401: Access Denied</TITLE></HEAD>[\n]" DEBUG 10:17:35 Wire - << "<BODY><H1>401: Access Denied</H1>[\n]" DEBUG 10:17:35 Wire - << "Proper authorization is required for this area. Either your browser does not perform authorization, or your authorization has failed.[\n]" DEBUG 10:17:35 Wire - << "</BODY></HTML>" DEBUG 10:17:35 HttpMethodBase - Should close connection in response to directive: close DEBUG 10:17:35 HttpConnection - enter HttpConnection.close() DEBUG 10:17:35 HttpConnection - enter HttpConnection.closeSockedAndStreams() DEBUG 10:17:35 HttpConnection - enter HttpConnection.releaseConnection() DEBUG 10:17:35 HttpConnection - Releasing connection back to connection manager. DEBUG 10:17:35 HttpMethodBase - enter getContentCharSet( Header contentheader ) DEBUG 10:17:35 HeaderElement - enter HeaderElement.parseElements(String) DEBUG 10:17:35 HeaderElement - enter HeaderElement.parseElements(char[]) DEBUG 10:17:35 HeaderElement - enter HeaderElement.getParameterByName(String) DEBUG 10:17:35 HttpMethodBase - Default charset used: ISO-8859-1 <HTML><HEAD><TITLE>401: Access Denied</TITLE></HEAD> <BODY><H1>401: Access Denied</H1> Proper authorization is required for this area. Either your browser does not perform authorization, or your authorization has failed. </BODY></HTML> 2. We have implemented SSO with SiteMinder User authenticated and logon to the main site, user can click on the links from the main site (which is also protected by siteminder) but without having to authenticated again. We would like to use httpclient to connect to the other links from the main site, how do I tell httpclient to use the existing session information from the main site to avoid SiteMinder authentication again. Thanks in advance. Regards Wilson Wong __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com From httpclient-user-returnjoseph86@example.com Mon Oct 02 15:08:25 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 1670 invoked from network); 2 Oct 2006 15:08:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 15:08:25 -0000 Received: (qmail 29920 invoked by uid 500); 2 Oct 2006 15:08:22 -0000 Delivered-To: joseph86@example.com Received: (qmail 29901 invoked by uid 500); 2 Oct 2006 15:08:22 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 29881 invoked by uid 99); 2 Oct 2006 15:08:22 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 08:08:22 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [83.161.120.155] ([83.161.120.155:54632] helo=moutng.kundenserver.de) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id 03/1C-16499-D4B21254 for <joseph86@example.com>; Mon, 02 Oct 2006 08:08:03 -0700 Received: from [83.161.120.155] (helo=[83.161.120.155]) by mrelayeu.kundenserver.de (node=mrelayeu1) with ESMTP (Nemesis), id 0MKwpI-1GUPO713z8-0004XJ; Mon, 02 Oct 2006 17:07:23 +0200 Message-ID: <joseph86@example.com> Date: Mon, 02 Oct 2006 17:10:06 +0200 From: Roland Weber <joseph86@example.com> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060428 X-Accept-Language: en-us, en MIME-Version: 1.0 To: HttpClient User Discussion <joseph86@example.com> Subject: Re: ProtocolException question References: <joseph86@example.com> <joseph86@example.com> <joseph86@example.com> In-Reply-To: <joseph86@example.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de joseph86@example.com login:4601b1d39ab4ddfc21c613822e406392 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Glenn, as Julius suspected, the server doesn't respond with an HTTP status line. > 2006-10-02 09:33:40 DEBUG header wire:69 >> "POST /xxxxxxx/xxxxxxx.cgi > HTTP/1.1[\r][\n]" > [...] > 2006-10-02 09:33:40 DEBUG content wire:83 >> *** DATA REMOVED *** > 2006-10-02 09:33:40 DEBUG EntityEnclosingMethod writeRequestBody:504 > Request body sent So far, so good. Now we're waiting for "HTTP/1.1 200 OK" or some such: > 2006-10-02 09:33:40 DEBUG HttpMethodBase readStatusLine:1823 enter > HttpMethodBase.readStatusLine(HttpState, HttpConnection) > 2006-10-02 09:33:41 DEBUG header wire:69 << "XXXXXXXXXXXXXXXXXXX=XX[\r] > [\n]" and this is what we get instead! It's not a status line, it's not a header line. Either the server is generating garbage, or you have a problem with thread synchronization. If multiple threads are using the same connection (which shouldn't be possible with the MultiThreadedHttpConnectionManager), then this could be explained as the response body for some other request. cheers, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com From httpclient-user-returnjoseph86@example.com Mon Oct 02 15:10:28 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 2388 invoked from network); 2 Oct 2006 15:10:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 15:10:28 -0000 Received: (qmail 33197 invoked by uid 500); 2 Oct 2006 15:10:26 -0000 Delivered-To: joseph86@example.com Received: (qmail 33179 invoked by uid 500); 2 Oct 2006 15:10:26 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 33161 invoked by uid 99); 2 Oct 2006 15:10:26 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 08:10:26 -0700 Authentication-Results: idunn.apache.osuosl.org joseph86@example.com; domainkeys=good X-ASF-Spam-Status: No, hits=3.3 required=5.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,INFO_TLD DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 Received: from [83.161.120.155] ([83.161.120.155:33445] helo=wx-out-0506.google.com) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id A9/1C-16499-CBB21254 for <joseph86@example.com>; Mon, 02 Oct 2006 08:09:54 -0700 Received: by wx-out-0506.google.com with SMTP id t4so1567122wxc for <joseph86@example.com>; Mon, 02 Oct 2006 08:09:00 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=iXLAd8QZXb8xYLCpMG+WMOcW4W4fLlWNn4qaB8Kv9gwpib4VFOwSEeSazMEzi5oitwePtKJiguiNKUFSFC53tVrrUxu998sWYToFiHfK+rRAiN7Pohe3hWa+uVqHgCUEGI9VEKGNBgqYc5PZ5jPWRI5Mr0ACuNvFPcTn+PiWT9E= Received: by 83.161.120.155 with SMTP id o16mr11647921wxb; Mon, 02 Oct 2006 08:09:00 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Mon, 2 Oct 2006 08:09:00 -0700 (PDT) Message-ID: <joseph86@example.com> Date: Mon, 2 Oct 2006 10:09:00 -0500 From: "Information Guzzler" <joseph86@example.com> To: joseph86@example.com Subject: HTTP post initiates new session -- need to avoid it. MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_49507_12413149.1159801740278" X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_49507_12413149.1159801740278 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline The application is designed to generate HTTP post request to a URL with couple of parameters. The response to this request needs to be displayed in a new browser window. This new window will generate all future request to the application. I use HttpClient to generate the request to the new URL which has the same context. The problem arises when the post request is generated, a new session is created and the response is displayed. At this point there are 2 jsessions active- the one with which the Http request was generated and the other which was initiated to display the reponse in new window. When I try to use the application in the new window it uses the initial session and hence does not find the application related session attributes which are stored in the session used to display the response. I need to avoid the creation of new session when a new window is opened to display the reponse to Http post request. I use the following String url = "http://localhost:8085/app/Login.do"; HttpClient client = new HttpClient(); client.getState().addCookie(new Cookie("localhost:8085","jsessionid", request.getSession().getId(), "app", null, false)); PostMethod method = new PostMethod( url ); // Configure the form parameters method.addParameter( "encryptedData", encryptedData ); method.addParameter( "HMAC", HMAC); method.addParameter( "jsessionid", request.getSession().getId()); log.info("Open browser"+url); int statusCode; // Execute the POST method try { statusCode = client.executeMethod(method); } catch(IOException e) { statusCode = -1; log.info("IOexception"); } log.info("status code"+statusCode); if( statusCode != -1 ) { String contents = method.getResponseBodyAsString(); response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println(contents); method.releaseConnection(); Regards Sushil ------=_Part_49507_12413149.1159801740278-- From httpclient-user-returnjoseph86@example.com Mon Oct 02 15:18:12 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 7167 invoked from network); 2 Oct 2006 15:18:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 15:18:12 -0000 Received: (qmail 49061 invoked by uid 500); 2 Oct 2006 15:18:11 -0000 Delivered-To: joseph86@example.com Received: (qmail 48916 invoked by uid 500); 2 Oct 2006 15:18:11 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 48905 invoked by uid 99); 2 Oct 2006 15:18:11 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from [83.161.120.155] (HELO moutng.kundenserver.de) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 08:18:10 -0700 Received: from [83.161.120.155] (helo=[83.161.120.155]) by mrelayeu.kundenserver.de (node=mrelayeu1) with ESMTP (Nemesis), id 0MKwpI-1GUPYB1Nty-0004Pn; Mon, 02 Oct 2006 17:17:47 +0200 Message-ID: <joseph86@example.com> Date: Mon, 02 Oct 2006 17:20:32 +0200 From: Roland Weber <joseph86@example.com> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060428 X-Accept-Language: en-us, en MIME-Version: 1.0 To: HttpClient User Discussion <joseph86@example.com> Subject: Re: httpclient and siteminder References: <joseph86@example.com> In-Reply-To: <joseph86@example.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de joseph86@example.com login:4601b1d39ab4ddfc21c613822e406392 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello Wilson, > hc.getState().setCredentials(new > AuthScope("https://www.foo.com/apps", 443), That authentication scope does not make any sense. Please read the JavaDocs: http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/auth/AuthScope.html What you are passing as "host" is not a joseph86@example.com. Either register the default credentials with scope AuthScope.ANY or use the constructor correctly: new AuthScope("www.foo.com", 443) hope that helps, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com From httpclient-user-returnjoseph86@example.com Mon Oct 02 15:23:54 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 11541 invoked from network); 2 Oct 2006 15:23:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 15:23:53 -0000 Received: (qmail 59945 invoked by uid 500); 2 Oct 2006 15:23:52 -0000 Delivered-To: joseph86@example.com Received: (qmail 59932 invoked by uid 500); 2 Oct 2006 15:23:52 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 59921 invoked by uid 99); 2 Oct 2006 15:23:52 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from [83.161.120.155] (HELO moutng.kundenserver.de) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 08:23:52 -0700 Received: from [83.161.120.155] (helo=[83.161.120.155]) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis), id 0ML21M-1GUPdd0Rht-0002l4; Mon, 02 Oct 2006 17:23:25 +0200 Message-ID: <joseph86@example.com> Date: Mon, 02 Oct 2006 17:26:09 +0200 From: Roland Weber <joseph86@example.com> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060428 X-Accept-Language: en-us, en MIME-Version: 1.0 To: HttpClient User Discussion <joseph86@example.com> Subject: Re: HTTP post initiates new session -- need to avoid it. References: <joseph86@example.com> In-Reply-To: <joseph86@example.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de joseph86@example.com login:4601b1d39ab4ddfc21c613822e406392 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello Sushil, > HttpClient client = new HttpClient(); > client.getState().addCookie(new Cookie("localhost:8085","jsessionid", > request.getSession().getId(), "app", null, false)); What is "request" here? Are you mixing up client and server side? Have you read what our primer has to say about sessions? http://wiki.apache.org/jakarta-httpclient/ForAbsoluteBeginners Are you trying to share a session between the browser and the server-side code that seems to be using HttpClient? That is not possible. cheers, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com From httpclient-user-returnjoseph86@example.com Mon Oct 02 17:13:27 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 68436 invoked from network); 2 Oct 2006 17:13:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 17:13:27 -0000 Received: (qmail 82376 invoked by uid 500); 2 Oct 2006 17:13:27 -0000 Delivered-To: joseph86@example.com Received: (qmail 82229 invoked by uid 500); 2 Oct 2006 17:13:26 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 82216 invoked by uid 99); 2 Oct 2006 17:13:26 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 10:13:26 -0700 Authentication-Results: idunn.apache.osuosl.org joseph86@example.com; domainkeys=good X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 Received: from [83.161.120.155] ([83.161.120.155:24040] helo=web60723.mail.yahoo.com) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id BB/F1-24395-0B841254 for <joseph86@example.com>; Mon, 02 Oct 2006 10:13:22 -0700 Received: (qmail 61533 invoked by uid 60001); 2 Oct 2006 17:13:18 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Qyyd4D24/crnlkfl9BWRBMXIbC8cGrqRUuZ+U6hK6kBflJv2ThdMFezbLXYL7yxY84bqk5dDVYaqWmRenw2CXVnLR7Q3VmWJEqtt+dxrKV9DwMMY10j6cxZSyX3uNTNZWqgSciccP0LCmu+G9VcGLbPHvCpYNjTKnbc5zzDmNfA= ; Message-ID: <joseph86@example.com> Received: from [83.161.120.155] by web60723.mail.yahoo.com via HTTP; Mon, 02 Oct 2006 10:13:17 PDT Date: Mon, 2 Oct 2006 10:13:17 -0700 (PDT) From: wilson wong <joseph86@example.com> Subject: Re: httpclient and siteminder To: HttpClient User Discussion <joseph86@example.com> In-Reply-To: <joseph86@example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Roland, Change to "new AuthScope("www.foo.com", 443)" as suggested by you it worked! Thanks so much I have second question :) We have implemented SSO with SiteMinder User authenticated and logon to the main site, user can click on the other links (via href) from the main site which is also protected by siteminder but without having to authenticated again. We would like to use httpclient to connect to the other links from the main site, how do I tell httpclient to use the existing session information from the main site to avoid SiteMinder authentication again. Thanks for your time Regards Wilson --- Roland Weber <joseph86@example.com> wrote: > Hello Wilson, > > > hc.getState().setCredentials(new > > AuthScope("https://www.foo.com/apps", 443), > > That authentication scope does not make any sense. > Please read the JavaDocs: > http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/auth/AuthScope.html > > What you are passing as "host" is not a joseph86@example.com. > Either register the default credentials with scope > AuthScope.ANY or use the constructor correctly: > new AuthScope("www.foo.com", 443) > > hope that helps, > Roland > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > joseph86@example.com > For additional commands, e-mail: > joseph86@example.com > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: joseph86@example.com For additional commands, e-mail: joseph86@example.com From httpclient-user-returnjoseph86@example.com Mon Oct 02 17:24:24 2006 Return-Path: <httpclient-user-returnjoseph86@example.com> Delivered-To: joseph86@example.com Received: (qmail 74734 invoked from network); 2 Oct 2006 17:24:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Oct 2006 17:24:24 -0000 Received: (qmail 11618 invoked by uid 500); 2 Oct 2006 17:24:22 -0000 Delivered-To: joseph86@example.com Received: (qmail 11605 invoked by uid 500); 2 Oct 2006 17:24:22 -0000 Mailing-List: contact joseph86@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:joseph86@example.com> List-Unsubscribe: <mailto:joseph86@example.com> List-Post: <mailto:joseph86@example.com> List-Id: "HttpClient User Discussion" <httpclient-user.jakarta.apache.org> Reply-To: "HttpClient User Discussion" <joseph86@example.com> Delivered-To: mailing list joseph86@example.com Received: (qmail 11594 invoked by uid 99); 2 Oct 2006 17:24:22 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 10:24:22 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [83.161.120.155] ([83.161.120.155:57128] helo=moutng.kundenserver.de) by idunn.apache.osuosl.org (ecelerity 83.161.120.155 r(12930)) with ESMTP id 39/52-24395-24B41254 for <joseph86@example.com>; Mon, 02 Oct 2006 10:24:19 -0700 Received: from [83.161.120.155] (helo=[83.161.120.155]) by mrelayeu.kundenserver.de (node=mrelayeu6) with ESMTP (Nemesis), id 0ML29c-1GURWZ0xVa-0008VB; Mon, 02 Oct 2006 19:24:15 +0200 Message-ID: <joseph86@example.com> Date: Mon, 02 Oct 2006 19:26:59 +0200 From: Roland Weber <joseph86@example.com> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060428 X-Accept-Language: en-us, en MIME-Version: 1.0 To: HttpClient User Discussion <joseph86@example.com> Subject: Re: httpclient and siteminder References: <joseph86@example.com> In-Reply-To: <joseph86@example.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de joseph86@example.com login:4601b1d39ab4ddfc21c613822e406392 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello Wilson, > We would like to use httpclient to connect to the > other links from the main site, how do I tell > httpclient to use the existing session information > from
{'source': 'Apache Software Foundation Public Mail Archives'}