HttpComponent connector = new HttpComponent(); HttpEndpoint endpoint = new HttpEndpoint(); endpoint.setRole(Role.CONSUMER); endpoint.setLocationURI("http: endpoint.setSoap(false); endpoint.setDefaultMep(SoapHelper.IN_ONLY); endpoint.setService(new QName("test", "receiver")); endpoint.setEndpoint("BC"); connector.setEndpoints(new HttpEndpoint[] { endpoint }); ActivationSpec asConnector = new ActivationSpec("connector", connector); container.activateComponent(asConnector);
HttpConnector connector = new HttpConnector("localhost", 8192); connector.setDefaultInOut(false); ActivationSpec asConnector = new ActivationSpec("connector", connector); asConnector.setDestinationService(new QName("test", "receiver")); container.activateComponent(asConnector);
	protected long testInOnly(String msg, boolean streaming) throws Exception {		// HTTP Component		HttpComponent component = new HttpComponent();		component.getConfiguration().setStreamingEnabled(streaming);		container.activateComponent(component, "HttpProviderTest");		// Add a receiver component		Receiver receiver = new ReceiverComponent();		ActivationSpec asReceiver = new ActivationSpec("receiver", receiver);		asReceiver.setService(new QName("test", "receiver"));		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_ONLY);        endpoint.setService(new QName("test", "receiver"));        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);		RobustInOnly in = client.createRobustInOnlyExchange();		in.setInterfaceName(new QName("http://http.servicemix.org/Test",				"ProviderInterface"));		in.getInMessage().setContent(				new StreamSource(new ByteArrayInputStream(msg.getBytes())));		long t0 = System.currentTimeMillis();		client.sendSync(in);		long t1 = System.currentTimeMillis();		assertTrue(in.getStatus() == ExchangeStatus.DONE);		// Check we received the message		receiver.getMessageList().assertMessagesReceived(1);		component.getServiceUnitManager().stop("provider");		component.getServiceUnitManager().shutDown("provider");		component.getServiceUnitManager().undeploy("provider",				path.getAbsolutePath());		return t1 - t0;	}