Package org.apache.servicemix.nmr.api

Examples of org.apache.servicemix.nmr.api.Channel.sendSync()


        Channel channel = smx.createChannel();
        Exchange e = channel.createExchange(Pattern.InOnly);
        e.getIn().setBody("<hello/>");
        e.setTarget(smx.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, "{uri:foo}bar:ep")));
        channel.sendSync(e);
    }
}
View Full Code Here


        Channel client = nmr.createChannel();
        Exchange e = client.createExchange(Pattern.InOut);
        for (Endpoint ep : nmr.getEndpointRegistry().getServices()) {
            e.setTarget(nmr.getEndpointRegistry().lookup(nmr.getEndpointRegistry().getProperties(ep)));
            e.getIn().setBody(new StringSource("<?xml version=\"1.0\" encoding=\"UTF-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><ns2:sayHi xmlns:ns2=\"http://cxf.examples.servicemix.apache.org/\"><arg0>Bonjour</arg0></ns2:sayHi></soap:Body></soap:Envelope>"));
            boolean res = client.sendSync(e);
            assertTrue(res);
        }
   
    }
View Full Code Here

        Channel channel = smx.createChannel();
        Exchange e = channel.createExchange(Pattern.InOnly);
        e.getIn().setBody("<hello/>");
        e.setTarget(smx.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, "{uri:foo}bar:ep")));
        channel.sendSync(e);
        if (e.getError() != null) {
            throw e.getError();
        }
        assertEquals(Status.Done, e.getStatus());
    }
View Full Code Here

        final Exchange exchange = channel.createExchange(Pattern.InOnly);
        exchange.setTarget(nmr.getEndpointRegistry().lookup(props));
       
        Thread thread = new Thread(new Runnable() {
            public void run() {
                channel.sendSync(exchange);
                done.countDown();
            }
        });
        thread.start();
       
View Full Code Here

                ServiceHelper.createMap(Endpoint.NAME, RECEIVER_ENDPOINT_NAME)));
        exchange.setProperty("prop1", "value1");
        exchange.getIn().setBody(content);
        exchange.getIn().setHeader("prop1", "value2");
        exchange.getIn().setHeader("prop2", "value3");
        client.sendSync(exchange);

    }

    protected ReceiverEndpoint createReceiver(NMR nmr, boolean fault, boolean error) throws Exception {
        ReceiverEndpoint receiver = new ReceiverEndpoint(fault, error);
View Full Code Here

        }
        e.getIn().setBody(exchange.getIn().getBody());
        e.getIn().setHeader(CxfConstants.OPERATION_NAME,
            exchange.getIn().getHeader(CxfConstants.OPERATION_NAME));
               
        client.sendSync(e);
        if (e.getPattern() != Pattern.InOnly) {
          if (e.getFault().getBody() != null) {
            exchange.getFault().setBody(e.getFault().getBody());
          } else
            exchange.getOut().setBody(e.getOut().getBody());
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.