HttpComponent component = new HttpComponent();
component.getConfiguration().setStreamingEnabled(streaming);
container.activateComponent(component, "HTTPComponent");
// Add a receiver component
Receiver receiver = new ReceiverComponent();
ActivationSpec asReceiver = new ActivationSpec("receiver", receiver);
asReceiver.setService(new QName("http://http.servicemix.org/Test", "ConsumerInOnly"));
container.activateComponent(asReceiver);
// Add the http invoker
HttpInvoker invoker = new HttpInvoker();
invoker.setDefaultInOut(false);
invoker.setUrl("http://localhost:8192/InOnly/");
invoker.setMarshaler(new HttpSoapClientMarshaler(true));
ActivationSpec asInvoker = new ActivationSpec("invoker", invoker);
asInvoker.setService(new QName("urn:test", "invoker"));
container.activateComponent(asInvoker);
// Start container
container.start();
// Deploy SU
URL url = getClass().getClassLoader().getResource("consumer/http.wsdl");
File path = new File(new URI(url.toString()));
path = path.getParentFile();
component.getServiceUnitManager().deploy("consumer", path.getAbsolutePath());
component.getServiceUnitManager().start("consumer");
// Call it
DefaultServiceMixClient client = new DefaultServiceMixClient(container);
RobustInOnly in = client.createRobustInOnlyExchange();
in.setService(new QName("urn:test", "invoker"));
in.getInMessage().setContent(new StreamSource(new ByteArrayInputStream(msg.getBytes())));
long t0 = System.currentTimeMillis();
client.sendSync(in);
long t1 = System.currentTimeMillis();
assertEquals(ExchangeStatus.DONE, in.getStatus());
// Check we received the message
receiver.getMessageList().assertMessagesReceived(1);
return t1 - t0;
}