}
public void process(Exchange exchange) throws Exception {
NMR nmr = getEndpoint().getComponent().getNmr();
Channel client = nmr.createChannel();
org.apache.servicemix.nmr.api.Exchange e = client.createExchange(
Pattern.fromWsdlUri(exchange.getPattern().getWsdlUri()));
try {
e.setTarget(nmr.getEndpointRegistry().lookup(
ServiceHelper.createMap(org.apache.servicemix.nmr.api.Endpoint.NAME,
getEndpoint().getEndpointName())));
} catch (Exception ex) {
ex.printStackTrace();
}
e.getIn().setBody(exchange.getIn().getBody());
e.getIn().setHeader(CxfConstants.OPERATION_NAME,
exchange.getIn().getHeader(CxfConstants.OPERATION_NAME));
client.sendSync(e);
if (e.getPattern() != Pattern.InOnly) {
if (e.getFault().getBody() != null) {
exchange.getFault().setBody(e.getFault().getBody());
} else
exchange.getOut().setBody(e.getOut().getBody());