ExchangeImpl cxfExchange = new ExchangeImpl();
// set the Bus on the exchange in case the CXF interceptor need to access it from exchange
cxfExchange.put(Bus.class, endpoint.getBus());
// prepare binding operation info
BindingOperationInfo boi = prepareBindingOperation(camelExchange, cxfExchange);
Map<String, Object> invocationContext = new HashMap<String, Object>();
Map<String, Object> responseContext = new HashMap<String, Object>();
invocationContext.put(Client.RESPONSE_CONTEXT, responseContext);
invocationContext.put(Client.REQUEST_CONTEXT, prepareRequest(camelExchange, cxfExchange));
CxfClientCallback cxfClientCallback = new CxfClientCallback(callback, camelExchange, cxfExchange, boi,
endpoint.getCxfBinding());
// send the CXF async request
client.invoke(cxfClientCallback, boi, getParams(endpoint, camelExchange),
invocationContext, cxfExchange);
if (boi.getOperationInfo().isOneWay()) {
callback.done(false);
}
} catch (Throwable ex) {
// error occurred before we had a chance to go async
// so set exception and invoke callback true