Package org.apache.servicemix.client

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


            inMessage.setContent(new StringSource("<test id='" + i + "'/>"));
            inOut.setInMessage(inMessage);
            client.send(inOut);
            inOut = (InOut) client.receive(1000);
            assertNotNull(inOut.getOutMessage());
            client.done(inOut);
        }
    }

}
View Full Code Here


            if (me.getError() != null) {
                throw me.getError();
            }
        }
        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
        client.done(me);
       
        Thread.sleep(50);
       
        return receiver.sentSoapAction;
    }
View Full Code Here

        me.setOperation(new QName("receive"));
        NormalizedMessage nm = me.getInMessage();
        nm.setContent(new StringSource("<hello>world</hello>"));
        client.sendSync(me);
        assertExchangeWorked(me);
        client.done(me);
    }
   
    protected void assertExchangeWorked(MessageExchange me) throws Exception {
        if (me.getStatus() == ExchangeStatus.ERROR) {
            if (me.getError() != null) {
View Full Code Here

        InOut exchange = client.createInOutExchange();
        exchange.setEndpoint(se);
        exchange.getInMessage().setContent(new StringSource("<hello>world</hello>"));
        client.sendSync(exchange);
        client.done(exchange);

        assertExchangeWorked(exchange);

        ListenerBean bean = (ListenerBean) getBean("listenerBean");
        MessageExchange answer = bean.getLastExchange();
View Full Code Here

        message.setProperty("name", "cheese");
        message.setContent(new StringSource("<hello>world</hello>"));

        client.sendSync(me);
        client.done(me);
        assertExchangeWorked(me);

        ListenerBean bean = (ListenerBean) getBean("listenerBean");
        assertNotNull("Bean should bave been invoked", bean.getLastExchange());
View Full Code Here

        me.getInMessage().setContent(new StringSource("<hello>world</hello>"));
       
        tm.begin();
        boolean ok = client.sendSync(me);
        assertTrue(ok);
        client.done(me);
        tm.commit();
    }
   
    public void testAsync() throws Exception {
        EchoComponent echo = new EchoComponent();
View Full Code Here

       
        tm.begin();
        client.send(me);
        tm.commit();
        me = (InOut) client.receive();
        client.done(me);
    }
   
}
View Full Code Here

        InOut me = dest.createInOutExchange();
        me.getInMessage().setContent(new StringSource("<hello>world</hello>"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
        String str = new SourceTransformer().contentToString(me.getOutMessage());
        client.done(me);
        logger.info(str);
    }

    public void testSoapRoundtripProviderConsumerProvider() throws Exception {
        EchoComponent echo = new EchoComponent();
View Full Code Here

        DataHandler dh = new DataHandler(ds);
        me.getInMessage().addAttachment("image", dh);
        client.sendSync(me);
        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
        assertEquals(1, me.getOutMessage().getAttachmentNames().size());
        client.done(me);
    }
   
}
View Full Code Here

                fail("Received ERROR status");
            }
        } else {
            logger.info(new SourceTransformer().toString(me.getOutMessage().getContent()));
        }
        client.done(me);
    }
   
}
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.