Package org.apache.servicemix.client

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


        container.activateComponent(http, "http");

        container.start();

        ServiceMixClient client = new DefaultServiceMixClient(container);
        InOut me = client.createInOutExchange();
        me.setService(new QName("http://servicemix.apache.org/samples/wsdl-first", "PersonService"));
        me.setOperation(new QName("http://servicemix.apache.org/samples/wsdl-first", "GetPerson"));
        me.getInMessage().setContent(new StringSource(
                                "<jbi:message xmlns:jbi=\"http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper\""
                             "             xmlns:msg=\"http://servicemix.apache.org/samples/wsdl-first/types\" "
View Full Code Here


        container.activateComponent(receiver, "Receiver");
       
        container.start();

        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut me = client.createInOutExchange();
        me.setInterfaceName(new QName("http://jsr181.servicemix.apache.org", "ComplexPojoPortType"));
        me.getInMessage().setContent(new StringSource(
                "<oneWay xmlns='http://jsr181.servicemix.apache.org'><in0>world</in0></oneWay>"));
        client.sendSync(me);
       
View Full Code Here

        container.activateComponent(as);
       
        container.start();

        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut me = client.createInOutExchange();
        me.setInterfaceName(new QName("http://jsr181.servicemix.apache.org", "ComplexPojoPortType"));
        me.getInMessage().setContent(new StringSource(
                "<twoWay xmlns='http://jsr181.servicemix.apache.org'><in0>world �</in0></twoWay>"));
        client.sendSync(me);
        log.info(new SourceTransformer().contentToString(me.getOutMessage()));
View Full Code Here

        container.activateComponent(as);
       
        container.start();

        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut me = client.createInOutExchange();
        me.setInterfaceName(new QName("http://jsr181.servicemix.apache.org", "ComplexPojoPortType"));
        me.getInMessage().setContent(new StringSource("<hel lo>world</hello"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
        assertNotNull(me.getFault());
View Full Code Here

        // For lack of a better way of doing this:
        component.getServiceUnitManager().deploy("HelloWorld", examples + "/HelloWorld2/HelloWorld2-process/");
        component.getServiceUnitManager().init("HelloWorld", examples + "/HelloWorld2/HelloWorld2-process/");
        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());
    logger.info(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

            component.getServiceUnitManager().deploy("su1", path.getAbsolutePath());
            component.getServiceUnitManager().init("su1", path.getAbsolutePath());
            component.getServiceUnitManager().start("su1");

            // Send message
            InOut inout = client.createInOutExchange();
            inout.setService(new QName("http://servicemix.apache.org/demo/", "chained"));
            client.send(inout);

            // Stop and undeploy
            component.getServiceUnitManager().stop("su1");
View Full Code Here

            component.getServiceUnitManager().stop("su1");
            component.getServiceUnitManager().shutDown("su1");
            component.getServiceUnitManager().undeploy("su1", path.getAbsolutePath());

            // Send message
            inout = client.createInOutExchange();
            inout.setService(new QName("http://servicemix.apache.org/demo/", "chained"));
            try {
                client.send(inout);
            } catch (MessagingException e) {
                // Ok, the lw component is undeployed
View Full Code Here

            component.getServiceUnitManager().deploy("su1", path.getAbsolutePath());
            component.getServiceUnitManager().init("su1", path.getAbsolutePath());
            component.getServiceUnitManager().start("su1");

            // Send message
            InOut inout = client.createInOutExchange();
            inout.setService(new QName("http://servicemix.apache.org/demo/", "chained"));
            client.send(inout);

            // Stop and undeploy
            component.getServiceUnitManager().stop("su1");
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.