use of com.sun.xml.ws.api.pipe.Codec in project metro-jax-ws by eclipse-ee4j.
the class ReferenceParametersTest method useStreamCodec.
Message useStreamCodec(String msg) throws IOException {
Codec codec = Codecs.createSOAPEnvelopeXmlCodec(SOAPVersion.SOAP_11);
Packet packet = new Packet();
ByteArrayInputStream in = new ByteArrayInputStream(msg.getBytes());
codec.decode(in, "text/xml", packet);
return packet.getMessage();
}
use of com.sun.xml.ws.api.pipe.Codec in project metro-jax-ws by eclipse-ee4j.
the class GlobalNsDeclTest method useStreamCodec.
Message useStreamCodec(String msg) throws IOException {
Codec codec = Codecs.createSOAPEnvelopeXmlCodec(SOAPVersion.SOAP_11);
Packet packet = new Packet();
ByteArrayInputStream in = new ByteArrayInputStream(msg.getBytes());
codec.decode(in, "text/xml", packet);
return packet.getMessage();
}
use of com.sun.xml.ws.api.pipe.Codec in project metro-jax-ws by eclipse-ee4j.
the class CharactersTest method handleCharacters.
private void handleCharacters(int size) throws Exception {
BindingID bid = BindingID.parse(SOAPBinding.SOAP11HTTP_MTOM_BINDING);
BindingImpl binding = (BindingImpl) bid.createBinding();
Codec codec = binding.createCodec();
TestMessage msg = new TestMessage(size);
Packet packet = new Packet();
codec.decode(msg.getInputStream(), msg.getContentType(), packet);
ByteArrayOutputStream bout = new ByteArrayOutputStream();
XMLStreamWriter sw = XMLStreamWriterFactory.create(bout);
packet.getMessage().writeTo(sw);
sw.close();
InputStream in = new ByteArrayInputStream(bout.toByteArray());
XMLStreamReader sr = XMLStreamReaderFactory.create(null, in, true);
while (sr.hasNext()) {
sr.next();
if (sr.getEventType() == XMLStreamReader.START_ELEMENT && sr.getLocalName().equals("doc1")) {
assertEquals(msg.getEncodedText(), sr.getElementText().trim());
}
}
}
use of com.sun.xml.ws.api.pipe.Codec in project metro-jax-ws by eclipse-ee4j.
the class StreamMessageTest method createSOAP11StreamMessage.
private StreamMessage createSOAP11StreamMessage(String msg) throws IOException {
Codec codec = Codecs.createSOAPEnvelopeXmlCodec(SOAPVersion.SOAP_11);
Packet packet = new Packet();
ByteArrayInputStream in = new ByteArrayInputStream(msg.getBytes());
codec.decode(in, "text/xml", packet);
return (StreamMessage) packet.getMessage();
}
use of com.sun.xml.ws.api.pipe.Codec in project metro-jax-ws by eclipse-ee4j.
the class BodyPrologueAndEpilogueTest method useStreamCodec.
private StreamMessage useStreamCodec(String msg) throws IOException {
Codec codec = Codecs.createSOAPEnvelopeXmlCodec(SOAPVersion.SOAP_11);
Packet packet = new Packet();
ByteArrayInputStream in = new ByteArrayInputStream(msg.getBytes());
codec.decode(in, "text/xml", packet);
return (com.sun.xml.ws.message.stream.StreamMessage) packet.getInternalMessage();
}
Aggregations