Search in sources :

Example 16 with Codec

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();
}
Also used : Packet(com.sun.xml.ws.api.message.Packet) Codec(com.sun.xml.ws.api.pipe.Codec) ByteArrayInputStream(java.io.ByteArrayInputStream)

Example 17 with Codec

use of com.sun.xml.ws.api.pipe.Codec in project metro-jax-ws by eclipse-ee4j.

the class ReferenceParametersTest method useStream12Codec.

Message useStream12Codec(String msg) throws IOException {
    Codec codec = Codecs.createSOAPEnvelopeXmlCodec(SOAPVersion.SOAP_12);
    Packet packet = new Packet();
    ByteArrayInputStream in = new ByteArrayInputStream(msg.getBytes());
    codec.decode(in, "application/soap+xml", packet);
    return packet.getMessage();
}
Also used : Packet(com.sun.xml.ws.api.message.Packet) Codec(com.sun.xml.ws.api.pipe.Codec) ByteArrayInputStream(java.io.ByteArrayInputStream)

Example 18 with Codec

use of com.sun.xml.ws.api.pipe.Codec in project metro-jax-ws by eclipse-ee4j.

the class Test method useStream12Codec.

public static Message useStream12Codec(String msg) throws IOException {
    Codec codec = Codecs.createSOAPEnvelopeXmlCodec(SOAPVersion.SOAP_12);
    Packet packet = new Packet();
    ByteArrayInputStream in = new ByteArrayInputStream(msg.getBytes());
    codec.decode(in, "application/soap+xml", packet);
    return packet.getMessage();
}
Also used : Codec(com.sun.xml.ws.api.pipe.Codec) ByteArrayInputStream(java.io.ByteArrayInputStream)

Example 19 with Codec

use of com.sun.xml.ws.api.pipe.Codec in project metro-jax-ws by eclipse-ee4j.

the class StreamMessageCopyTest 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("utf-8"));
    codec.decode(in, "text/xml", packet);
    return (StreamMessage) packet.getMessage();
}
Also used : Packet(com.sun.xml.ws.api.message.Packet) Codec(com.sun.xml.ws.api.pipe.Codec) ByteArrayInputStream(java.io.ByteArrayInputStream) StreamMessage(com.sun.xml.ws.message.stream.StreamMessage)

Aggregations

Codec (com.sun.xml.ws.api.pipe.Codec)19 ByteArrayInputStream (java.io.ByteArrayInputStream)13 Packet (com.sun.xml.ws.api.message.Packet)12 ContentType (com.sun.xml.ws.api.pipe.ContentType)3 IOException (java.io.IOException)3 Attachment (com.sun.xml.ws.api.message.Attachment)2 Message (com.sun.xml.ws.api.message.Message)2 MimeAttachmentSet (com.sun.xml.ws.message.MimeAttachmentSet)2 StreamMessage (com.sun.xml.ws.message.stream.StreamMessage)2 ByteArrayBuffer (com.sun.xml.ws.util.ByteArrayBuffer)2 WebServiceException (jakarta.xml.ws.WebServiceException)2 XMLStreamWriter (javax.xml.stream.XMLStreamWriter)2 BindingID (com.sun.xml.ws.api.BindingID)1 WSBinding (com.sun.xml.ws.api.WSBinding)1 BindingImpl (com.sun.xml.ws.binding.BindingImpl)1 MtomCodec (com.sun.xml.ws.encoding.MtomCodec)1 SOAPBindingCodec (com.sun.xml.ws.encoding.SOAPBindingCodec)1 XMLHTTPBindingCodec (com.sun.xml.ws.encoding.XMLHTTPBindingCodec)1 XMLCodec (com.sun.xml.ws.encoding.xml.XMLCodec)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1