commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Buistov" <>
Subject RE: [httpclient] question
Date Sun, 12 Oct 2003 13:16:37 GMT
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?)

-----Original Message-----
From: Oleg Kalnichevski []
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. 


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message