You can add the following sample catch clause for the timeout exception to your client code:
catch (Exception ex) { String exMsg = ex.getMessage(); if (exMsg.indexOf("Read timed out") >= 0) { // Catch socket timeouts. System.out.println("Read Timeout doing GetUpdates. Redoing GetUpdates."); } else { // Other exceptions are noted and passed on. System.out.println("Got Exception in GetUpdates: " + ex.getMessage()); ex.printStackTrace(System.out); throw ex; } }
In some situations, you may also want to increase the length of the socket timeout period. The following sample code changes the timeout for a Java client using Axis 1.1:
VmaBindingStub vma = new VmaBindingStub(endPointURL, vmaService); //Set socket timeout to 30 minutes or 1800 seconds. ((org.apache.axis.client.Stub)this.vma).setTimeout(1800000);