title: AXIS2 How to set connection retry?
body: <p>It seems that the Axis admin client org.apache.axis2.client.ServiceClient 
  is issuing org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry() and 
  the retry is like 3 times by default. Is there a way to set to not do retries?</p>
  
  <p>My code:</p>
  
  <pre><code>        ServiceClient client = new ServiceClient();
          Options opts = new Options();
          opts.setTo(new EndpointReference(strWebServiceUrl));
          opts.setAction(strNameOfMethodToInvoke);
          opts.setTimeOutInMilliSeconds(timeOut);
          client.setOptions(opts);
          OMElement res = client.sendReceive(createRequest());
          return (res.toString());
  </code></pre>
  
  <hr>
  
  <p>The code now is</p>
  
  <pre><code>        ServiceClient client = new ServiceClient();
          Options opts = new Options();
          opts.setTo(new EndpointReference(strWebServiceUrl));
          opts.setAction("urn:" + strNameOfMethodToInvoke);
          opts.setTimeOutInMilliSeconds(timeOut);
  
          HttpMethodParams methodParams = new HttpMethodParams();
          DefaultHttpMethodRetryHandler retryHandler = new DefaultHttpMethodRetryHandler(0, false);
          methodParams.setParameter(HttpMethodParams.RETRY_HANDLER, retryHandler);
          opts.setProperty(HTTPConstants.HTTP_METHOD_PARAMS, methodParams);
  
          client.setOptions(opts);
          OMElement res = client.sendReceive(createRequest());
          return (res.toString());
  </code></pre>