Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 36552 invoked from network); 12 Oct 2003 14:26:22 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 12 Oct 2003 14:26:22 -0000 Received: (qmail 31468 invoked by uid 500); 12 Oct 2003 14:26:12 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 31451 invoked by uid 500); 12 Oct 2003 14:26:12 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 31409 invoked from network); 12 Oct 2003 14:26:11 -0000 Received: from unknown (HELO zorg.miratech-software.com) (212.60.55.105) by daedalus.apache.org with SMTP; 12 Oct 2003 14:26:11 -0000 Received: from mtx-mail.msg (mtx-mail [10.16.3.2]) by zorg.miratech-software.com (Postfix) with ESMTP id 30C9C7E5 for ; Sun, 12 Oct 2003 16:26:12 +0200 (CEST) content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Subject: RE: [httpclient] question X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Date: Sun, 12 Oct 2003 17:26:11 +0300 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [httpclient] question Thread-Index: AcOQytu/lDsOYdYdT9KBxDJz/RBSpQAAHglQ From: "Alexey Buistov" To: "Jakarta Commons Users List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello Mike! Your first solution is inapplicable in my case just because server code = isn't available for me. Concerning the second solution: "single request and two responses" model = is a requierement, so=20 I have to live with it. So, as I've got from your posting it's = unimplementable not only using HttpClient, but using HTTP itself, am I right? Alexey -----Original Message----- From: Michael Becke [mailto:becke@u.washington.edu] Sent: Sunday, October 12, 2003 5:12 PM To: Jakarta Commons Users List Subject: Re: [httpclient] question Hi Alexey, HTTP is a single request, single response protocol. For every request=20 GET/POST/PUT there is exactly one response. The situation you describe=20 requires a single request and two responses. The only way I can see to=20 solve this is to change the process on the server side. Most likely=20 you will need to do one of the following: - remove the confirmation response and make the client wait for the=20 real response - break down the process into two requests, one to make the request to = the server, and one to get the response. Mike On Sunday, October 12, 2003, at 09:16 AM, Alexey Buistov wrote: > Hello Oleg! > > I've reinvestigated the problem and found that you're right. The=20 > response is being returned, > but my problem still remains :( > > How should I implement the following using HttpClient? > > 1) send a business-request to server (no problem) > 2) server returns confirmation response: I've just got your request=20 > and going to process it. Standby! (no problem) > 3) server processes that request and _notifies_ the client: Done=20 > processing successfully. (that's where I've stuck. The old=20 > implementation I try to get rid of uses some kind of socket observer=20 > which queries the socket from time to time and finally gets the server = > notification. Is this doable using HttpClient?) > > Alexey > > -----Original Message----- > From: Oleg Kalnichevski [mailto:olegk@bluewin.ch] > Sent: Sunday, October 12, 2003 12:48 PM > To: Jakarta Commons Users List > Subject: Re: [httpclient] question > > > Hi Alexey, > > Unless I am missing something, there is absolutely nothing you need to > change in your code. > >> HttpClient client =3D new HttpClient(); >> HostConfiguration hc =3D new HostConfiguration(); >> hc.setHost("localhost", 1010); >> client.setHostConfiguration(hc); >> PostMethod post =3D new PostMethod(); >> post.setRequestBody(requestBody); >> client.executeMethod(post); >> > > HTTP is a request/response oriented protocol by definition. HttpClient > will not return from executeMethod until it gets a response from the > server or a socket read timeout occurs (which is off per default). > Httpclient will continue listening on the socket at until it receives = a > response status line and a number of headers from the target server. > > Oleg > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org