ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jimisola Laursen" <>
Subject HttpClient - usage etc
Date Sat, 24 Sep 2005 15:13:57 GMT

I have server-client solution where we have problem with timeouts. Under 1.4 you
have to use properties to set read and/connection timeout for the whole program.
So, I was delighted to see that HttpClient is available in XMLRPC-2.0 as
timeouts can be set directly on the HttpClient.

However, I spend some time last night trying to figure out 1) how to actually
use it and 2) how to set timeouts.

Is there no factory class to use with XmlRpcClient constructor for use of 
HttpClient. The
DefaultXmlRpcTransportFactory seems to be more than just a plain factory class
as I in createTransportFactory noticed the Reflection construction call to a
constructor with signature  java.util.Properties properties

So, my questions are:

1) How do use Commons HttpClient and also set additional properties? Do I need
to create a new factory class or extend DefaultXmlRpcTransportFactory and then
adjust it after my needs? Or can I use DefaultXmlRpcTransportFactory as is - in
some way that I haven't been able to figure out yet? (might be interesting with
an example on the web site)

2) It says that "Note: Currently this transport is not thread safe":
What exactly does this mean? To refer to item 52 in Effective Java, is it:

 - conditionally thread-safe: thread-safe in methods are called in right 
 - thread-compatible: thread-safe if all methods have external synchronization 
(e.g. Collection classes)
 - thread-hostile: not thread-safe even if all methods have external 

Read on that " HttpClient is fully thread-safe when used with a thread-safe 
connection manager such as MultiThreadedHttpConnectionManager " (more info on
I am not very familiar with HttpClient, so bear with my questions. Does this 
thread-safety only apply for HttpClient 3.0 (which seems to be close now)?

Kind regards,

View raw message