Sergey,

As you suggested, I switched to pre-2.0 API WebClient and I was able to get
it to work, with no changes on the server side.  The timeout does not seem
to have any impact, the code works with or without it.  Here is the relevant
section:

        List providers = new ArrayList();

providers.add(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider.class);
        WebClient client = WebClient.create(targetUrl, providers);
        client.accept(MediaType.APPLICATION_JSON);
        client.type(MediaType.MULTIPART_FORM_DATA);

        // -- client config --
        HTTPConduit conduit = WebClient.getConfig(client).getHttpConduit();
        //conduit.getClient().setReceiveTimeout(1000000000L); 
        //conduit.getClient().setConnectionTimeout(1000000000L); 
        TLSClientParameters params = conduit.getTlsClientParameters();
        if (params == null) {
                params = new TLSClientParameters();
        }

        // -- 2-way HTTPS --
        TrustManagerFactory tmf = initTrustManagerFactory();
        KeyManagerFactory keyManagerFactory = initKeyManagerFactory();
        params.setTrustManagers(tmf.getTrustManagers());
        params.setKeyManagers(keyManagerFactory.getKeyManagers());
        params.setHostnameVerifier(getHostnameVerifier());
        conduit.setTlsClientParameters(params);

        // -- upload code --            
        InputStream is = new FileInputStream(theFile);
        ContentDisposition cd = new ContentDisposition("attachment;
name=\"fieldName\"; filename=\"rpm\"")'
        Attachment att = new Attachment("file", is, cd);
        response = client.post(att);

If there is a way to get it working with 2.0 API, please let me know.  

Cheers,
Liviu



--
View this message in context: 
http://cxf.547215.n5.nabble.com/Unable-to-upload-file-content-using-CXF-3-0-0-and-Jackson-2-2-0-tp5754611p5754687.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to