Hi Dan!
Daniel Kulp <[email protected]> wrote on 07/11/2010 04:52:35 AM:
> Actually, it may be the receive timeout, not the connect timeout.
That's
> what I normally run into when debugging. :-)
>
> In anycase, see:
>
http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html
I have a similar problem with a REST service created with cxf. What I have
found on the page is the following but that does not seem to work for us:
| Client client = ClientProxy.getClient(greeter);
| HTTPConduit http = (HTTPConduit) client.getConduit();
|
| HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
| httpClientPolicy.setConnectionTimeout(36000);
| httpClientPolicy.setAllowChunking(false);
| httpClientPolicy.setReceiveTimeout(32000);
|
| http.setClient(httpClientPolicy);
The problem is that we use a WebClient (see code below) which does not have
the getConduit function.
| WebClient client = WebClient.create(url).type(MediaType.
MULTIPART_FORM_DATA_TYPE).accept(MediaType.TEXT_PLAIN);
| // client.getHeaders().add("Connection", "Keep-Alive");
| // client.getHeaders().add("KeepAliveTimeout", "0");
| ArrayList<Attachment> attachments = new ArrayList<Attachment>();
| [...generate attachments...]
| return client.post(new MultipartBody(attachments), _class);
Any ideas of what we need to do, to set the timeout value correctly?
Adding those two headers, which we found elsewhere did not work either.
Thanks,
Thomas
--
Thomas Gschwind Email: [email protected]
IBM Zurich Research Lab
Saeumerstrasse 4 Tel: +41-44-724-8990
CH-8803 Rueschlikon, Switzerland Fax: +41-44-724-8953