There actually is an Oracle Support Note that talks about this - How to set Timeout for Weblogic Webservice Client(jaxws and jaxrpc) (Doc ID 1056121.1). This note is a little old and references some JAR files that no longer exist, so I didn't quite get the answer I was looking for here but it set me on the right path.
Lets see what the documented portable way of setting timeouts is... You need to cast your port object to a BindingProvider and then retrieve the request context, which is a Java Map of key/value pairs. Then, you set the connect and read timeout properties to whatever values you wish to use - this is specified in milliseconds. For example...
Java
Map requestContext = ((BindingProvider) port).getRequestContext();
requestContext.put(JAXWSProperties.CONNECT_TIMEOUT, 30000);
requestContext.put(JAXWSProperties.REQUEST_TIMEOUT, 30000);
Seems simple, right? Well it is, however it all depends on which JAXWSProperties class you import, which JDK you have and which application server you are running. This is where it gets difficult. I found that using the portable approach by setting properties from constant field values was not the best case. Due to the myriad of different property names out there that the same constant fields defined, I opted to use literal strings instead that I knew would work with WebLogic 12c...
Java
Map requestContext = ((BindingProvider) port).getRequestContext();
requestContext.put("com.sun.xml.ws.connect.timeout", 30000);
requestContext.put("com.sun.xml.ws.request.timeout", 30000);
That worked like a charm. I know it's not the cleanest way to do it, but it works very well in this case.
Here are a bunch of other property names that I've tried that had no effect...
Java
//requestContext.put("com.sun.xml.internal.ws.connect.timeout", 10);
//requestContext.put("com.sun.xml.internal.ws.request.timeout", 10);
//requestContext.put("oracle.webservices.httpReadTimeout", 10);
//requestContext.put("oracle.webservices.httpConnTimeout", 10);
//requestContext.put("javax.xml.ws.client.connectionTimeout", 10);
//requestContext.put("javax.xml.ws.client.receiveTimeout", 10);
By the way there's an open ticket over at the metro-jax-ws Git repository to address this very issue with not having a standardised set of properties - Standardize timeout settings #1166. This ticket was opened in 2015 and hasn't seen much traction.
-i