Examples of BytesSource


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

        SoapMarshaler marshaler = new SoapMarshaler(true);
        marshaler.setSoapUri(SoapMarshaler.SOAP_11_URI);
        SoapMessage msg = new SoapMessage();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        marshaler.createWriter(msg).write(baos);
        Node node = sourceTransformer.toDOMNode(new BytesSource(baos.toByteArray()));
        assertNotNull(node);
        Element root = ((Document) node).getDocumentElement();
        assertEquals(SoapMarshaler.SOAP_11_URI, root.getNamespaceURI());
    }
View Full Code Here

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

        }
        else {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            Result result = new StreamResult(buffer);
            transformer.transform(src, result);
            out.setContent(new BytesSource(buffer.toByteArray()));
        }
    }
View Full Code Here

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

        checkUserIdNamespace(node2);
       
        msg.setSource(new DOMSource(node2));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        marshaler.createWriter(msg).write(baos);
        Node node = sourceTransformer.toDOMNode(new BytesSource(baos.toByteArray()));
        checkUserIdNamespace(node);
  }
View Full Code Here

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

        SoapMarshaler marshaler = new SoapMarshaler(true);
        marshaler.setSoapUri(SoapMarshaler.SOAP_11_URI);
        SoapMessage msg = new SoapMessage();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        marshaler.createWriter(msg).write(baos);
        Node node = sourceTransformer.toDOMNode(new BytesSource(baos.toByteArray()));
        assertNotNull(node);
        Element root = ((Document) node).getDocumentElement();
        assertEquals(SoapMarshaler.SOAP_11_URI, root.getNamespaceURI());
    }
View Full Code Here

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

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

    public void testSerializeDeserializeWithBytesSource() throws Exception {
        Source src = new BytesSource("<hello>world</hello>".getBytes());
        testSerializeDeserialize(src);
    }
View Full Code Here

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

        }
        else {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            Result result = new StreamResult(buffer);
            transformer.transform(src, result);
            out.setContent(new BytesSource(buffer.toByteArray()));
        }
    }
View Full Code Here

Examples of org.servicemix.jbi.jaxp.BytesSource

            c.receive(ctx, msg);
           
            // Set response or DONE status
            if (isInAndOut(me)) {
                NormalizedMessage outMsg = me.createMessage();
                outMsg.setContent(new BytesSource(out.toByteArray()));
                me.setMessage(outMsg, "out");
            } else {
                me.setStatus(ExchangeStatus.DONE);
            }
           
View Full Code Here

Examples of org.servicemix.jbi.jaxp.BytesSource

        }
        else {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            Result result = new StreamResult(buffer);
            transformer.transform(in.getContent(), result);
            out.setContent(new BytesSource(buffer.toByteArray()));
        }
    }
View Full Code Here

Examples of org.servicemix.jbi.jaxp.BytesSource

    /**
     * Factory method to turn XML as bytes into some POJO which by default will
     * create a {@link BytesSource}
     */
    protected Object createXml(byte[] xmlBytes) {
        return new BytesSource(xmlBytes);
    }
View Full Code Here

Examples of org.servicemix.jbi.jaxp.BytesSource

  public void closeOutput() {
    try {
      baos.flush();
      baos.close();
      out.setContent(new BytesSource(baos.toByteArray()));
    } catch (Exception e) {
      throw (ClientTransportException) new ClientTransportException("Error retrieving input").initCause(e);
    }
  }
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.