public void testNMROsgi() throws Exception {
Thread.sleep(5000);
waitOnContextCreation("org.apache.servicemix.examples.itests.cxf-nmr-osgi");
Thread.sleep(5000);
NMR nmr = getOsgiService(NMR.class);
assertNotNull(nmr);
Channel client = nmr.createChannel();
Exchange e = client.createExchange(Pattern.InOut);
for (Endpoint ep : nmr.getEndpointRegistry().getServices()) {
e.setTarget(nmr.getEndpointRegistry().lookup(nmr.getEndpointRegistry().getProperties(ep)));
e.getIn().setBody(new StringSource("<?xml version=\"1.0\" encoding=\"UTF-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><ns2:sayHi xmlns:ns2=\"http://cxf.examples.servicemix.apache.org/\"><arg0>Bonjour</arg0></ns2:sayHi></soap:Body></soap:Envelope>"));
boolean res = client.sendSync(e);
assertTrue(res);
}