I am using the axis 2 to communicate with the third party webservices. This
webservice is going to be invoked in a timer for every 1 minute and the timer
is going to run for several days. Now my question is whether we need to create
the stub object everytime we make the webservice call or can we maintain the
stub object in the class level variable (timer object) and use the same object
all the time.
Will a axis fault exception make any changes to the stub. i mean do we need to
create a new stub instance when a axis fault exception (like timout, server
down) happens?
is the stub.cleanup alone is enough? or do we need to call the transport
cleanup as well?
My code
Public void method() {
try {
stub = new PartnerAPIStub(configurationContext, endPointRef);
... service call code
}
catch(Exception ex)
{
stub.cleanup();
stub = new PartnerAPIStub(configurationContext, endPointRef);
}
}
Thanks
Suresh