Package org.servicemix.jbi.jaxp

Examples of org.servicemix.jbi.jaxp.StringSource


        // START SNIPPET: content
        InOnly exchange = client.createInOnlyExchange();
        NormalizedMessage message = exchange.getInMessage();

        message.setContent(new StringSource("<hello>world!</hello>"));

        client.sendSync(exchange);
        // END SNIPPET: content
    }
View Full Code Here


        ServiceNameEndpointResolver resolver = new ServiceNameEndpointResolver(service);

        InOnly exchange = client.createInOnlyExchange(resolver);
        NormalizedMessage message = exchange.getInMessage();

        message.setContent(new StringSource("<order id='abc123'><customer>Duff Beer</customer><value>599.99</value></order>"));

        client.sendSync(exchange);
    }
View Full Code Here

    private SourceTransformer sourceTransformer = new SourceTransformer();

    public void toNMS(NormalizedMessage normalizedMessage, HttpMethod method) throws IOException, MessagingException {
        addNmsProperties(normalizedMessage, method);

        normalizedMessage.setContent(new StringSource(method.getResponseBodyAsString()));
    }
View Full Code Here

public class ASMarshaler {

    private XMLStreamFactory streamFactory = new XMLStreamFactory();

    public void setContent(NormalizedMessage message, String xml) throws MessagingException {
        message.setContent(new StringSource(xml));
    }
View Full Code Here

        for (int i = 0; i < count; i++) {
            InOnly exchange = client.createInOnlyExchange();
            NormalizedMessage message = exchange.getInMessage();

            message.setProperty("id", new Integer(i));
            message.setContent(new StringSource("<example id='" + i + "'/>"));

            client.send(exchange);
        }
    }
View Full Code Here

                }

                exchange.setInMessage(message);
                // lets set the XML as a byte[], String or DOM etc
                String xml = "<s12:Envelope xmlns:s12='http://www.w3.org/2003/05/soap-envelope'><s12:Body> <foo>Hello!</foo> </s12:Body></s12:Envelope>";
                message.setContent(new StringSource(xml));
                if (sync) {
                  context.getDeliveryChannel().sendSync(exchange, 4000);
                } else {
                  context.getDeliveryChannel().send(exchange);
                }
View Full Code Here

            InOnly exchange = factory.createInOnlyExchange();
            NormalizedMessage message = exchange.createMessage();
            exchange.setInMessage(message);

            message.setProperty("id", new Integer(i));
            message.setContent(new StringSource("<example id='" + i + "'/>"));

            deliveryChannel.send(exchange);
        }
    }
View Full Code Here

                NormalizedMessage message = exchange.createMessage();
                exchange.setEndpoint(endpoint);
                exchange.setInMessage(message);
                // lets set the XML as a byte[], String or DOM etc
                String xml = "<s12:Envelope xmlns:s12='http://www.w3.org/2003/05/soap-envelope'><s12:Body> <foo>Hello!</foo> </s12:Body></s12:Envelope>";
                message.setContent(new StringSource(xml));
                System.out.println("sending message: " + i);
                DeliveryChannel deliveryChannel = context.getDeliveryChannel();
                System.out.println("sync send on deliverychannel: " + deliveryChannel);
                if (sync) {
                  deliveryChannel.sendSync(exchange);
View Full Code Here

    protected void assertExpression(Expression expression, String expected, String xml) throws MessagingException {
        MessageExchangeImpl exchange = new InOnlyImpl("dummy");
        NormalizedMessage message = new NormalizedMessageImpl(exchange);
        message.setProperty("name", "James");
        message.setContent(new StringSource(xml));
        Object value = expression.evaluate(exchange, message);
        assertEquals("Expression: " + expression, expected, value);
    }
View Full Code Here

                throw new MessagingException("Failed to marshal: " + body + " to DOM document: " + e, e);
            }
        }
        else {
            String xml = getXStream().toXML(body);
            message.setContent(new StringSource(xml));
        }
    }
View Full Code Here

TOP

Related Classes of org.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.