Using the HAPI client and DSTU1 test server, I get java.net.SocketTimeoutException on a Patient search. I have not been able to understand how to set a higher timeout value.
ctx = new FhirContext();
client = ctx.newRestfulGenericClient(url);
However I also tried this:
ctx = new FhirContext();
RestfulClientFactory f = (RestfulClientFactory)ctx.getRestfulClientFactory();
f.setConnectionRequestTimeout(20);
f.setConnectTimeout(20);
f.setSocketTimeout(20);
client = f.newGenericClient(url);
and got an exception "unable to retrieve server metadata"
Does anyone have an example of setting the timeout correctly? Also, an explanation of the 3 different settings?