Package org.apache.servicemix.client

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


        component.getServiceUnitManager().deploy("HelloWorld", helloWorldDir);
        component.getServiceUnitManager().init("HelloWorld", helloWorldDir);
        component.getServiceUnitManager().start("HelloWorld");
        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut io = client.createInOutExchange();
        io.setService(new QName("urn:/HelloWorld2.wsdl", "HelloService"));
        io.setOperation(new QName("urn:/HelloWorld2.wsdl", "Hello"));
        io.getInMessage().setContent(new StreamSource(getClass().getResourceAsStream("/HelloWorldRequest.xml")));
        client.sendSync(io,20000);
        assertEquals(ExchangeStatus.ACTIVE,io.getStatus());
View Full Code Here


        component.getServiceUnitManager().deploy("HelloWorld", helloWorldDir);
        component.getServiceUnitManager().init("HelloWorld", helloWorldDir);
        component.getServiceUnitManager().start("HelloWorld");
        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut io = client.createInOutExchange();
        io.setService(new QName("urn:/HelloWorld2.wsdl", "HelloService"));
        io.setOperation(new QName("urn:/HelloWorld2.wsdl", "Hello"));
        io.getInMessage().setContent(new StreamSource(getClass().getResourceAsStream("/HelloWorldRequest.xml")));
        client.sendSync(io,20000);
        assertEquals(ExchangeStatus.ACTIVE,io.getStatus());
View Full Code Here

    st.execute("create table MyTable (id varchar(80) not null, name varchar(80))");
    st.execute("insert into MyTable values ('1', 'One')");
    st.execute("insert into MyTable values ('2', 'Two')");
   
    DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
    InOut me = client.createInOutExchange();
    me.setService(new QName("urn:jdbc", "service"));
    me.getInMessage().setContent(new StringSource("<sql>select * from MyTable</sql>"));
    client.sendSync(me);
    String out = new SourceTransformer().contentToString(me.getOutMessage());
    System.err.println(out);
View Full Code Here

        ActivationSpec activationSpec = new ActivationSpec("echo", echoComponent);
        activationSpec.setService(service);
        receiverContainer.activateComponent(activationSpec);
        DefaultServiceMixClient client = new DefaultServiceMixClient(senderContainer);
        for (int i = 0; i < 10; i++) {
            InOut inOut = client.createInOutExchange(service, null, null);
            NormalizedMessage inMessage = inOut.createMessage();
            inMessage.setContent(new StringSource("<test id='" + i + "'/>"));
            inOut.setInMessage(inMessage);
            client.send(inOut);
            inOut = (InOut) client.receive(1000);
View Full Code Here

        jbi.activateComponent(receiver, "receiver");

        jbi.start();
       
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("saaj"));
        me.getInMessage().setContent(new StringSource("<hello>world</hello>"));
        client.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
            if (me.getError() != null) {
View Full Code Here

    st.execute("create table MyTable (id varchar(80) not null, name varchar(80))");
    st.execute("insert into MyTable values ('1', 'One')");
    st.execute("insert into MyTable values ('2', 'Two')");
   
    DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
    InOut me = client.createInOutExchange();
    me.setService(new QName("urn:jdbc", "service"));
    me.getInMessage().setContent(new StringSource("<sql>select * from MyTable</sql>"));
    client.sendSync(me);
    String out = new SourceTransformer().contentToString(me.getOutMessage());
    log.info(out);
View Full Code Here

        jbi.activateComponent(echo2, "echo2");

        jbi.start();

        ServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("bean"));
        me.setOperation(new QName("receive"));
        NormalizedMessage nm = me.getInMessage();
        nm.setContent(new StringSource("<hello>world</hello>"));
        client.sendSync(me);
View Full Code Here

        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

    }

    public void testSendingInOutToStaticEndpoint() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);

        InOut me = client.createInOutExchange();
        me.setService(new QName("urn:test", "service"));
        NormalizedMessage message = me.getInMessage();

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

        super.setUp();
    }
   
    public void test() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        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

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.