}
getLogger().log(Level.FINE, "send the message to endpoint" + targetCamelEndpointUri);
// We could wait for the rely asynchronously
org.apache.camel.Exchange exchange = getCamelTemplate().send(targetCamelEndpointUri, pattern, new Processor() {
public void process(org.apache.camel.Exchange ex) throws IOException {
CachedOutputStream outputStream = (CachedOutputStream)outMessage.getContent(OutputStream.class);
// Send out the request message here, copy the protocolHeader back
CxfHeaderHelper.propagateCxfToCamel(headerFilterStrategy, outMessage, ex.getIn().getHeaders());
// TODO support different encoding
ex.getIn().setBody(outputStream.getBytes());
getLogger().log(Level.FINE, "template sending request: ", ex.getIn());
}
});
exchange.setProperty(CxfConstants.CXF_EXCHANGE, outMessage.getExchange());
if (!isOneWay) {