axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Sosnoski <...@sosnoski.com>
Subject Re: [Axis2] Create new client stubs on every call?
Date Thu, 20 Jan 2011 07:53:02 GMT
Hi Boris,

The stubs are reusable, but not reentrant - so if you're running
multiple threads you'll want to either create a new one each time
(higher overhead), cache them per thread, or synchronize around each use
(only if there's not much use, of course - in which case you're probably
better off creating a new one each time anyway).

  - Dennis


On 01/20/2011 07:58 PM, Boris Klug wrote:
> Hi,
>
> I have one question regarding the handling of the generated Java
> client code.
>
> To call a web service, I use the following code:
>
>       AServiceStub stub = new AServiceStub("http://....");
>       response = stub.methodeToCall(paramIn);
>
> My question is: Do I have to create the stub every time when I call a
> webservice or can I create the stub only once and use it over and over
> again? If I can reuse the stub, whats about mutiple thread calling web
> services? What is the best practice?
>
> Thanks in advance for your help.
>
> Mit freundlichen Grüßen
>
> Boris Klug
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Mime
View raw message