You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Güçlü Akkaya <gu...@gmail.com> on 2012/08/23 09:36:46 UTC

Axis2 Client Generation

Hi,

In the attachment i tried to implement a generic axis2 web service client,
which can handle concurrent request by multiple thread. In the attachment
you can find my implementation. While i  tried to test my code for a number
of requests client does not seem to have a problem (request count under
100). However afte making more than 100 requests i some instances i get the
following exception.


com.ardic.arcsp.ws.WsClientException: Error in the web servis method: +
http://localhost:9763/services/ ServiceName: PerfTest Operation Name:
getResult Payload: <dat:getResult xmlns:dat='
http://test.performance.ardic.com'><sleep>1000</sleep></dat:getResult>
Exception message: null
 at
com.ardic.arcsp.ws.impl.Axis2WsClientHelper.executeAxis2Request(Axis2WsClientHelper.java:363)
at
com.ardic.arcsp.ws.impl.Axis2WsClientHelper.executeRequest(Axis2WsClientHelper.java:171)
 at WorkerThreadTest.sendMessageToDevice(WorkerThreadTest.java:31)
at WorkerThreadTest.run(WorkerThreadTest.java:18)
 at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
 at java.lang.Thread.run(Thread.java:636)
java.lang.NullPointerException
at
org.apache.axis2.client.ServiceClient.cleanupTransport(ServiceClient.java:861)
 at
org.apache.axis2.client.ServiceClient.createClient(ServiceClient.java:666)
at
com.ardic.arcsp.ws.impl.Axis2WsClientHelper.executeAxis2Request(Axis2WsClientHelper.java:333)
 at
com.ardic.arcsp.ws.impl.Axis2WsClientHelper.executeRequest(Axis2WsClientHelper.java:171)
at WorkerThreadTest.sendMessageToDevice(WorkerThreadTest.java:31)
 at WorkerThreadTest.run(WorkerThreadTest.java:18)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
 at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)

The point is i get this exception on the client side while generating the
OperationClient instance. This code is inspired by the generated Stub code
by the wsdl2java tool and is only for development purposes.
As a result what i want to know is whether the client implementation is
correct and if there is a better solution for generating a client which can
handle concurrent and multi user requests.


Thank you

PS: Axis2WsClientHelper is the client code, MainTest is my test code for
testing the client.