Examples of createInOutExchange()


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

        component.getServiceUnitManager().deploy("proxy", getServiceUnitPath("proxy"));
        component.getServiceUnitManager().init("proxy", getServiceUnitPath("proxy"));
        component.getServiceUnitManager().start("proxy");
       
        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut me = client.createInOutExchange(new QName("http://test", "Echo"), null, null);
        me.setInMessage(me.createMessage());
        me.getInMessage().setContent(new StringSource("<echo xmlns='http://test'><msg>world</msg></echo>"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
        assertNotNull(me.getOutMessage());
View Full Code Here

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

        log.info("The bean has been invoked: " + bean.getLastExchange());
    }

    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

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

        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

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

        }
    }

    public void testSsl() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("http://test/ssl", "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

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

        http.setEndpoints(new HttpEndpointType[] {ep0, ep1 });
        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

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

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

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

    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

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

public class SaxonComponentTest extends SpringTestSupport {
    private static transient Log log = LogFactory.getLog(SaxonComponentTest.class);

    public void testXslt() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("urn:test", "xslt"));
        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

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

        client.done(me);
    }

    public void testXsltWithElement() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("urn:test", "xslt"));
        Element e = transformer.toDOMElement(new StreamSource(getClass().getResourceAsStream("/books.xml")));
        e = DOMUtil.getFirstChildElement(e);
        me.getInMessage().setContent(new DOMSource(e));
        client.sendSync(me);
View Full Code Here

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

        client.done(me);
    }

    public void testXsltDynamic() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("urn:test", "xslt-dynamic"));
        Element e = transformer.toDOMElement(new StreamSource(getClass().getResourceAsStream("/books.xml")));
        e = DOMUtil.getFirstChildElement(e);
        me.getInMessage().setContent(new DOMSource(e));
        me.getInMessage().setProperty("xslt.source", "classpath:transform.xsl");
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.