HttpComponent component = new HttpComponent(); component.getConfiguration().setStreamingEnabled(streaming); container.activateComponent(component, "HTTPComponent");
HttpComponent component = new HttpComponent(); ((HttpLifeCycle) component.getLifeCycle()).getConfiguration() .setStreamingEnabled(streaming); container.activateComponent(component, "HTTPComponent");
	protected String testInOut(String msg, boolean streaming) throws Exception {		// HTTP Component		HttpComponent component = new HttpComponent();		component.getConfiguration().setStreamingEnabled(streaming);		container.activateComponent(component, "HTTPComponent");		// Add a echo component		EchoComponent echo = new EchoComponent();		ActivationSpec asReceiver = new ActivationSpec("echo", echo);		asReceiver.setService(new QName("test", "echo"));		container.activateComponent(asReceiver);		// Add the http receiver        HttpComponent connector = new HttpComponent();        HttpEndpoint endpoint = new HttpEndpoint();        endpoint.setRole(Role.CONSUMER);        endpoint.setLocationURI("http://localhost:8192/");        endpoint.setSoap(false);        endpoint.setDefaultMep(SoapHelper.IN_OUT);        endpoint.setService(new QName("test", "echo"));        endpoint.setEndpoint("BC");        connector.setEndpoints(new HttpEndpoint[] { endpoint });        ActivationSpec asConnector = new ActivationSpec("connector", connector);        container.activateComponent(asConnector);		// Start container		container.start();		// Deploy SU		URL url = getClass().getClassLoader().getResource("provider/http.wsdl");		File path = new File(new URI(url.toString()));		path = path.getParentFile();		component.getServiceUnitManager().deploy("provider",				path.getAbsolutePath());		component.getServiceUnitManager().start("provider");		// Call it		DefaultServiceMixClient client = new DefaultServiceMixClient(container);		InOut inout = client.createInOutExchange();		inout.setInterfaceName(new QName("http://http.servicemix.org/Test",				"ProviderInterface"));		inout.getInMessage().setContent(				new StreamSource(new ByteArrayInputStream(msg.getBytes())));		long t0 = System.currentTimeMillis();		client.sendSync(inout);		long t1 = System.currentTimeMillis();		assertTrue(inout.getStatus() == ExchangeStatus.ACTIVE);		// Check we received the message		assertNotNull(inout.getOutMessage());		assertNotNull(inout.getOutMessage().getContent());		SourceTransformer sourceTransformer = new SourceTransformer();		String reply = sourceTransformer.toString(inout.getOutMessage()				.getContent());		String inputMesage = sourceTransformer.toString(new StreamSource(				new ByteArrayInputStream(msg.getBytes())));		System.out.println("Msg Sent [" + inputMesage + "]");		System.out.println("Msg Recieved [" + reply + "]");		assertEquals(inputMesage.length(), reply.length());		assertEquals(inputMesage, reply);		component.getServiceUnitManager().stop("provider");		component.getServiceUnitManager().shutDown("provider");		component.getServiceUnitManager().undeploy("provider",				path.getAbsolutePath());		System.out.println("Executed in " + (t1 - t0) + "ms");		return reply;	}