Axis2 Stub Creation

"Balachandran, Suresh (c)" <[email protected]>
Newsgroups gmane.text.xml.axis.user
Message-ID <3806FC682E821348A778A6665C1D03E345A76543@NAWINCBTMSX204.enterprisenet.org>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.