Package org.apache.servicemix.client

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


        log.info(transformer.toString(me.getOutMessage().getContent()));
    }

    public void testXQuery() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("urn:test", "xquery"));
        me.getInMessage().setContent(new StreamSource(getClass().getResourceAsStream("/books.xml")));
        client.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
            if (me.getError() != null) {
View Full Code Here


    private static Log logger = LogFactory.getLog(OSWorkflowFailureTest.class);

    public void test() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("urn:test", "service"));
        me.getInMessage().setContent(
                new StringSource("<example>WrongExampleValue</example>"));
        client.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
View Full Code Here

    private static Log logger = LogFactory.getLog(OSWorkflowSucessTest.class);

    public void test() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("urn:test", "service"));
        me.getInMessage().setContent(
                new StringSource("<example>ExampleValue</example>"));
        client.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
View Full Code Here

        client.done(me);
    }

    public void testXQueryInline() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("urn:test", "xquery-inline"));
        me.getInMessage().setContent(new StreamSource(getClass().getResourceAsStream("/books.xml")));
        client.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
            if (me.getError() != null) {
View Full Code Here

        client.done(me);
    }

    public void testXQueryDynamic() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("urn:test", "xquery-dynamic"));
        me.getInMessage().setContent(new StreamSource(getClass().getResourceAsStream("/books.xml")));
        me.getInMessage().setProperty("xquery.source", getClass().getResource("/query.xq"));
        client.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
View Full Code Here

        return new ClassPathXmlApplicationContext("org/apache/servicemix/itests/eipxslt.xml");
    }
   
    public void test() throws Exception {
        ServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.getInMessage().setContent(new StringSource("<hello>world</hello>"));
        me.setService(new QName("http://servicemix.org/test/", "routingSlip"));
        client.sendSync(me, 5000);
        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
        client.done(me);
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("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

          }
        }
        {
          if (testProperties.getProperty("nmr.service") != null) {
              DefaultServiceMixClient client = new DefaultServiceMixClient(jbiContainer);
              InOut io = client.createInOutExchange();
              io.setService(QName.valueOf(testProperties.getProperty("nmr.service")));
              io.setOperation(QName.valueOf(testProperties.getProperty("nmr.operation")));
              io.getInMessage().setContent(new StreamSource(new ByteArrayInputStream(request.getBytes())));
              client.sendSync(io,20000);
              assertEquals(ExchangeStatus.ACTIVE,io.getStatus());
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.