Package org.servicemix.jbi.jaxp

Examples of org.servicemix.jbi.jaxp.SourceTransformer


        NormalizedMessage inMessage = exchange.getMessage("in");
        if (inMessage == null) {
            throw new MessagingException("Null in message delivered!");
        }
        try {
            System.out.println(new SourceTransformer().toString(inMessage.getContent()));
        } catch (Exception e) {
            e.printStackTrace();
        }
        messageList.addMessage(inMessage);
        done(exchange);
View Full Code Here


                setEndpoint(null);
            }

            public ServiceEndpoint resolveEndpointReference(DocumentFragment fragment) {
                try {
                    SourceTransformer st = new SourceTransformer();
                    String xml = st.toString(fragment);
                    return (ServiceEndpoint) new XStream(new DomDriver()).fromXML(xml);
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
View Full Code Here

            this.service = service;
            this.endpoint = endpoint;
        }
        public DocumentFragment getAsReference(QName operationName) {
            try {
                SourceTransformer st = new SourceTransformer();
                String xml = new XStream(new DomDriver()).toXML(this);
                Document doc = (Document) st.toDOMNode(new StringSource(xml));
                DocumentFragment df = doc.createDocumentFragment();
                df.appendChild(doc.getDocumentElement());
                return df;
            } catch (Exception e) {
                throw new RuntimeException(e);
View Full Code Here

     */
    public void testGetReference() throws Exception {
        InternalEndpoint endpoint = new InternalEndpoint(null, "myEndpoint", new QName("http://foo.bar.com", "myService"));
        DocumentFragment df = EndpointReferenceBuilder.getReference(endpoint);
        assertNotNull(df);
        System.out.println(new SourceTransformer().toString(df));
    }
View Full Code Here

    protected SourceTransformer transformer;
    protected int messageCount = 20;
    protected SpringJBIContainer jbi;

    protected void setUp() throws Exception {
        transformer = new SourceTransformer();

        context = createBeanFactory();
        // TODO: check where this method is
        //context.setXmlValidating(false);
View Full Code Here

    protected SourceTransformer transformer;
    protected int messageCount = 20;
    protected SpringJBIContainer jbi;

    protected void setUp() throws Exception {
        transformer = new SourceTransformer();

        context = createBeanFactory();
        context.setXmlValidating(false);

        jbi = (SpringJBIContainer) context.getBean("jbi");
View Full Code Here

        NormalizedMessage msgOut = meOut.getMessage("in");
        assertNotNull(msgOut);
        assertEquals("myMsgValue", msgOut.getProperty("myMsgProp"));
        Source outSrc = msgOut.getContent();
        assertNotNull(outSrc);
        String outStr = new SourceTransformer().toString(outSrc);
        assertNotNull(outStr);
        System.out.println(outStr);
    }
View Full Code Here

        Source src = new StreamSource(new ByteArrayInputStream("<hello>world</hello>".getBytes()));
        testSerializeDeserialize(src);
    }

    public void testSerializeDeserializeWithDomSource() throws Exception {
        Source src = new SourceTransformer().toDOMSource(new StringSource("<hello>world</hello>"));
        testSerializeDeserialize(src);
    }
View Full Code Here

        Source src = new SourceTransformer().toDOMSource(new StringSource("<hello>world</hello>"));
        testSerializeDeserialize(src);
    }

    public void testSerializeDeserializeWithSaxSource() throws Exception {
        Source src = new SourceTransformer().toSAXSource(new StringSource("<hello>world</hello>"));
        testSerializeDeserialize(src);
    }
View Full Code Here

TOP

Related Classes of org.servicemix.jbi.jaxp.SourceTransformer

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.