The properties in the accepted answer did not work for me, possibly because I'm using the JBoss implementation of JAX-WS?
Using a different set of properties (found in the JBoss JAX-WS User Guide) made it work:
//Set timeout until a connection is established
((BindingProvider)port).getRequestContext().put("javax.xml.ws.client.connectionTimeout", "6000");
//Set timeout until the response is received
((BindingProvider) port).getRequestContext().put("javax.xml.ws.client.receiveTimeout", "1000");