commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Buistov" <ABuis...@miratech.ua>
Subject RE: [httpclient] question
Date Sun, 12 Oct 2003 14:26:11 GMT
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 
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 
GET/POST/PUT there is exactly one response.  The situation you describe 
requires a single request and two responses.  The only way I can see to 
solve this is to change the process on the server side.  Most likely 
you will need to do one of the following:

  - remove the confirmation response and make the client wait for the 
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 
> 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 
> and going to process it. Standby! (no problem)
>  3) server processes that request and _notifies_ the client: Done 
> processing successfully. (that's where I've stuck. The old 
> implementation I try to get rid of uses some kind of socket observer 
> 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 = new HttpClient();
>>         HostConfiguration hc = new HostConfiguration();
>>         hc.setHost("localhost", 1010);
>>         client.setHostConfiguration(hc);
>>         PostMethod post = 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


Mime
View raw message