Examples of createInOutExchange()


Examples of javax.jbi.messaging.MessageExchangeFactory.createInOutExchange()

        NormalizedMessage message = EasyMock.createMock(NormalizedMessage.class);
        ByteArrayInputStream messageStream = new ByteArrayInputStream(TEST_MESSAGE.getBytes());
       
        channel.createExchangeFactoryForService(serviceName);
        EasyMock.expectLastCall().andReturn(factory);
        factory.createInOutExchange();
        EasyMock.expectLastCall().andReturn(exchange);
        exchange.createMessage();
        EasyMock.expectLastCall().andReturn(message);
        exchange.getEndpoint();
        EasyMock.expectLastCall().andReturn(null);
View Full Code Here

Examples of javax.jbi.messaging.MessageExchangeFactory.createInOutExchange()

            assert ws != null;
            QName interfaceName = new QName(ws.targetNamespace(), ws.name());
           
            MessageExchangeFactory factory = channel.createExchangeFactoryForService(serviceName);
            LOG.fine("create message exchange svc: " + serviceName);
            InOut xchng = factory.createInOutExchange();
           
            NormalizedMessage inMsg = xchng.createMessage();
            LOG.fine("exchange endpoint: " + xchng.getEndpoint());
           
            InputStream ins = null;
View Full Code Here

Examples of javax.jbi.messaging.MessageExchangeFactory.createInOutExchange()

                channel.send(io);
            }
        } else {
            if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
                MessageExchangeFactory factory = channel.createExchangeFactory();
                InOut io = factory.createInOutExchange();
                MessageUtil.transferInToIn(exchange, io);
                io.setService(new QName("echo"));
                io.setProperty("exchange", exchange);
                channel.send(io);
            } else if (exchange.getStatus() == ExchangeStatus.DONE) {
View Full Code Here

Examples of javax.jbi.messaging.MessageExchangeFactory.createInOutExchange()

        }
       
        public Source twoWay(Source src) throws Exception {
            DeliveryChannel channel = context.getDeliveryChannel();
            MessageExchangeFactory factory = channel.createExchangeFactory();
            InOut inout = factory.createInOutExchange();
            inout.setService(ReceiverComponent.SERVICE);
            NormalizedMessage msg = inout.createMessage();
            msg.setContent(src);
            inout.setInMessage(msg);
            channel.sendSync(inout);
View Full Code Here

Examples of org.apache.servicemix.client.DefaultServiceMixClient.createInOutExchange()

public class ScriptComponentTest extends SpringTestSupport {
    private static transient Log log = LogFactory.getLog(ScriptComponentTest.class);

    public void testGroovy() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("urn:test", "groovy"));
        me.getInMessage().setContent(new StringSource("<hello>world</hello>"));
        client.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
            if (me.getError() != null) {
View Full Code Here

Examples of org.apache.servicemix.client.DefaultServiceMixClient.createInOutExchange()

        client.done(me);
    }
   
    public void testRuby() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("urn:test", "jruby"));
        me.getInMessage().setContent(new StringSource("<hello>world</hello>"));
        client.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
            if (me.getError() != null) {
View Full Code Here

Examples of org.apache.servicemix.client.DefaultServiceMixClient.createInOutExchange()

                        container.getRegistry().getExternalEndpointsForService(
                                        new QName("http://test", "MySoapService"))[0]));

        // Test
        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut me = client.createInOutExchange();
        me.setService(new QName("http://test", "MyProviderService"));
        me.getInMessage().setContent(new StringSource("<echo xmlns='http://test'><echoin0>world</echoin0></echo>"));
        client.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
            if (me.getFault() != null) {
View Full Code Here

Examples of org.apache.servicemix.client.DefaultServiceMixClient.createInOutExchange()

        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);
View Full Code Here

Examples of org.apache.servicemix.client.DefaultServiceMixClient.createInOutExchange()

    private static transient Log log = LogFactory.getLog(HttpAddressingTest.class);

    public void testOk() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("http://test", "MyProviderService"));
        InputStream fis = getClass().getResourceAsStream("addressing-request.xml");
        me.getInMessage().setContent(new StreamSource(fis));
        client.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
View Full Code Here

Examples of org.apache.servicemix.client.DefaultServiceMixClient.createInOutExchange()

        DocumentFragment epr = URIResolver.createWSAEPR("bean:listenerBean");
        ServiceEndpoint se = client.getContext().resolveEndpointReference(epr);
        assertNotNull("We should find a service endpoint!", se);

        InOut exchange = client.createInOutExchange();
        exchange.setEndpoint(se);
        exchange.getInMessage().setContent(new StringSource("<hello>world</hello>"));
        client.sendSync(exchange);
        client.done(exchange);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.