On Jan 22, 2008 4:07 PM, <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a couple of questions regarding Axis2.
>
> ====================
> 1) Are wdsl2java generated stubs with XMLBeans data binding thread-safe,
> i.e. can the stub be re-used in a concurrent environment?
>
> In other words, would the following be "reasonable sane" code :-)
>
> ConfigurationContext context =
> ConfigurationContextFactory.createBasicConfigurationContext(AXIS2_CONFIG
> URATION);
> SomeServiceStub stub = new SomeServiceStub(context , someUrl);
> SomeServiceResponseDocument response1;
> SomeServiceResponseDocument response2:
> new Thread(new Runnable() {
> public void run() {
> response1 = stub.SomeService(aReqDoc1);
> }
> }).start();
> new Thread(new Runnable() {
> public void run() {
> response2 = stub.SomeService(aReqDoc2);
> }
> }).start();
>
> (And yes I know that there is an asynch facility with callback in Axis,
> the above was just to illustrate my question)
AFAIK, the stubs are stateless. Hence you should be able to reuse the stub
instances. You could write a test that exercises the section in your code
that starts two thread over several thousand iterations. You could provide 2
different requests, and compare the responses against the expected response
(provided that the response should be different)
>
>
> ====================
> 2) When calling more than 1 stub (not necessarily the same stub
> instance) in parallel, will the transport requests also be in parallel?
> Is there a difference here between the synch and asych case?
>
> ====================
>
Yes, the transport requests should be in parallel. Otherwise the system is
going to be very poor in performance.
>
>
> regards
> Morten
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Thanks
Afkham Azeez
http://www.wso2.org
GPG Fingerprint: 643F C2AF EB78 F886 40C9 B2A2 4AE2 C887 665E 0760