Client client = ClientProxy.getClient(yourPortType); HTTPConduit httpConduit = (HTTPConduit) client.getConduit(); HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); httpClientPolicy.setConnectionTimeout(5000); httpClientPolicy.setReceiveTimeout(5000); httpConduit.setClient(httpClientPolicy);
You should add this chunk of code before you call the method on yourPortType. The connectionTimeout is how long it may take to connect to the service, the receiveTimeout is how long it may take for the webservice to respond.