Louis Orenstein created CXF-6651:
------------------------------------
Summary: POST request to Exchange Web Services failing with
largish data via NTLM
Key: CXF-6651
URL: https://issues.apache.org/jira/browse/CXF-6651
Project: CXF
Issue Type: Bug
Reporter: Louis Orenstein
As documented here (
http://cxf.547215.n5.nabble.com/CXF-IOUtils-truncating-POST-request-content-td5761619.html
), I'm seeing issues when attempting to send largish POST requests to Exchange
Web Services when using NTLM authentication using CXF version 3.1.3 .
When the server only has Basic authentication enabled I can get POST requests
larger than 256k to succeed but only if I provide my own IOUtils class that
removes these lines from the copy method defined on line 180:
{code}
if (avail > 262144) {
avail = 262144;
}
{code}
Here is the code I'm using to configure the SOAP client:
{code}
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);
{code}
I'll be attaching wireshark network captures from the Exchange Web Services
server along with debug logging from the client.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)