FWIW here's my code configuring the bus & conduit:

        ExchangeWebService exchangeWebService = new ExchangeWebService();
        ExchangeServicePortType exchangeConn =
exchangeWebService.getExchangeWebPort();

       
((BindingProvider)exchangeConn).getRequestContext().put(AsyncHTTPConduit.USE_ASYNC,
Boolean.TRUE);
       
((BindingProvider)exchangeConn).getRequestContext().put(Credentials.class.getName(),
                new NTCredentials(finalUsername, password, null,
finalDomain));
        ((BindingProvider)
exchangeConn).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
wsdlURL);

        Client client = ClientProxy.getClient(exchangeConn);

        Bus bus = client.getBus();
        bus.setExtension(new AsyncHTTPConduitFactory(bus) {
            @Override
            protected void adaptClientBuilder(HttpAsyncClientBuilder
httpAsyncClientBuilder) {
                httpAsyncClientBuilder.setTargetAuthenticationStrategy(new
TargetAuthenticationStrategy() {
                    @Override
                    protected boolean isCachable(AuthScheme authScheme) {
                        return false;
                    }
                });
            }

            @Override
            public HTTPConduit createConduit(HTTPTransportFactory f, Bus
bus, EndpointInfo localInfo, EndpointReferenceType target) throws
IOException {
                HTTPConduit newConduit = super.createConduit(f, bus,
localInfo, target);
                HTTPClientPolicy clientPolicy = newConduit.getClient();
                if (clientPolicy == null) {
                    clientPolicy = new HTTPClientPolicy();
                }
                clientPolicy.setAutoRedirect(true);
                clientPolicy.setAllowChunking(false);
               
clientPolicy.setConnectionTimeout(connTimeout.orElse(EXCHANGE_CONNECT_TIMEOUT));
               
clientPolicy.setReceiveTimeout(reqTimeout.orElse(EXCHANGE_REQUEST_TIMEOUT));
                newConduit.setClient(clientPolicy);
                return newConduit;
            }
        }, HTTPConduitFactory.class);

And here's a listing of CXF's temp directory:
        448155 Oct 11 08:59 cos4445977419887489515tmp
        262144 Oct 11 08:59 cos5255388977599556617tmp

The POST eventually fails due to a timeout since the server is still waiting
for the entire POST contents but all the client sends on the final request
is the 256k contained in the 2nd file listed above.

And if it matters at all this is accessing a Microsoft Exchange Web Services
endpoint



--
View this message in context: 
http://cxf.547215.n5.nabble.com/CXF-IOUtils-truncating-POST-request-content-tp5761619p5761718.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to