Package org.apache.servicemix.jbi.jaxp

Examples of org.apache.servicemix.jbi.jaxp.StringSource


    public void testXsltWithParam() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("urn:test", "xslt-params"));
        me.getInMessage().setContent(new StringSource("<sample id='777888' sent='"
                + new Date() + "'>hello world!</sample>"));
        client.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
            if (me.getError() != null) {
                throw me.getError();
View Full Code Here


        for (int i = 0; i < NUMBER; i++) {
            InOnly me = client.createInOnlyExchange();
            me.setService(new QName("urn:test", "service"));
            NormalizedMessage message = me.getInMessage();
            message.setProperty(DefaultFileMarshaler.FILE_NAME_PROPERTY, "test" + i + ".xml");
            message.setContent(new StringSource(sb.toString()));
            client.sendSync(me);
        }

        Receiver receiver = (Receiver) getBean("receiver");
        receiver.getMessageList().assertMessagesReceived(NUMBER);
View Full Code Here

        assertNotNull("We should find a service endpoint!", se);

        InOnly exchange = client.createInOnlyExchange();
        exchange.setEndpoint(se);
        exchange.getInMessage().setProperty(DefaultFileMarshaler.FILE_NAME_PROPERTY, "test.xml");
        exchange.getInMessage().setContent(new StringSource("<hello>world</hello>"));
        client.sendSync(exchange);

        assertExchangeWorked(exchange);
    }
View Full Code Here

        if (me instanceof InOnly) {
            me.setError(new Exception(content));
            getChannel().send(me);
        } else {
            Fault fault = me.createFault();
            fault.setContent(new StringSource(content));
            me.setFault(fault);
            getChannel().sendSync(me);
        }
        update();
    }
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("Remote invocation request: " + request);
        }

        return new StringSource(request);
    }
View Full Code Here

    }

    public void answer(String content) throws Exception {
        MessageExchange me = this.exchange.getInternalExchange();
        NormalizedMessage out = me.createMessage();
        out.setContent(new StringSource(content));
        me.setMessage(out, "out");
        getChannel().sendSync(me);
        update();
    }
View Full Code Here

            InOnly me = client.createInOnlyExchange();
            me.setService(new QName("urn:test", "service"));
            NormalizedMessage message = me.getInMessage();
   
            message.setProperty(DefaultFileMarshaler.FILE_NAME_PROPERTY, "test2.xml");
            message.setContent(new StringSource("<hello>world</hello>"));
   
            client.sendSync(me);
            assertExchangeWorked(me);
        }
    }
View Full Code Here

                    }
                } else if (me.getStatus() == ExchangeStatus.ACTIVE) {
                    if (me.getFault() != null) {
                        JDOMResult result = new JDOMResult();
                        String str = getTransformer().contentToString(me.getFault());
                        getTransformer().toResult(new StringSource(str), result);
                        Element e = result.getDocument().getRootElement();
                        e = (Element) e.clone();
                        me.setStatus(ExchangeStatus.DONE);
                        channel.send(me);
                        XFireFault xfireFault = new XFireFault(str, XFireFault.RECEIVER);
View Full Code Here

    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("<hello>world</hello>"));
        client.sendSync(me);
        // By default, the endpoint throws an UnsupportedOperationException
        // so do not test anything here
    }
View Full Code Here

        log.info(getService().getLocalPart() + " requested");
        try {
            String output = "<getLoanQuoteResponse xmlns=\"urn:logicblaze:soa:bank\"><rate>"
                + (Math.ceil(1000 * Math.random()) / 100) + "</rate></getLoanQuoteResponse>";
            NormalizedMessage answer = inOut.createMessage();
            answer.setContent(new StringSource(output));
            answer(inOut, answer);
        } catch (Exception e) {
            throw new MessagingException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.servicemix.jbi.jaxp.StringSource

Copyright © 2018 www.massapicom. 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.