As far as I know CXF does not use Apache HttpClient, but straight java.net.HttpUrlConnection? How many connections? How do you scale concurrency on that (I don't know, I've only ever used HttpClient)? Is it thread-safe?


Daniel Kulp wrote:
On Wed March 11 2009 10:49:28 am Benson Margulies wrote:
My gut reaction is that this is not supposed to work. Synchronization
has overhead. If we put a synchronized(this) around the body of the
invocations, the single-threaded users pay the price and they don't
need it. If you do it, it's three lines of code and all is well.
However, I'm not the expert here in the JAX-WS standard to which we
strive to conform, so I'm somewhat waiting for word from Dan.

No, that is something that SHOULD be working except for the limitations noted at:
http://cxf.apache.org/faq.html#FAQ-AreJAXWSclientproxiesthreadsafe%25253F

Dan


On Wed, Mar 11, 2009 at 10:43 AM, Cornel Masson

<[email protected]> wrote:
Yes.....

Benson Margulies wrote:
And you are using that client object, unprotected by a syncronization,
in multiple threads?



On Wed, Mar 11, 2009 at 10:32 AM, Cornel Masson

<[email protected]> wrote:
My final solution uses the CXF Client (org.apache.cxf.endpoint.Client)
directly, constructed using the JaxWs Spring factory bean.

<bean id="cxfClientFactory"
class="org.apache.cxf.jaxws.JaxWsClientFactoryBean" scope="prototype">
 <property name="serviceClass"
value="com.shazam.internal.recognition.webservices.v1.SIFoRInterface"/>
</bean>

Code:

 //"cxfClientFactory" injected via Spring, then...
 cxfClientFactory.setAddress(url);
 Client client = cxfClientFactory.create();

and used:

 Object[] results = client.invoke(aMethodName, aRequest);


That's it.

-Cornel
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________

Reply via email to