Package com.sun.xml.internal.ws.api.pipe

Examples of com.sun.xml.internal.ws.api.pipe.ContentType


    @Override
    public ContentType getStaticContentType(Packet packet) {
        setRootCodec(packet);

        ContentType ct = null;
        if (packet.getMessage() instanceof MessageDataSource) {
            final MessageDataSource mds = (MessageDataSource)packet.getMessage();
            if (mds.hasUnconsumedDataSource()) {
                ct = getStaticContentType(mds);
                return (ct != null)
View Full Code Here


                p.getMessage().getAttachments();
                codec.getStaticContentType(p);

                ByteArrayBuffer bos = new ByteArrayBuffer();
                ContentType ct = codec.encode(p, bos);
                return XMLMessage.createDataSource(ct.getContentType(), bos.newInputStream());
            } else if (!isFastInfoset && useFastInfoset) {
                // Convert from XML to Fast Infoset
                Codec codec = new XMLHTTPBindingCodec(binding);
                Packet p = new Packet();
                codec.decode(in.getInputStream(), in.getContentType(), p);

                p.contentNegotiation = ContentNegotiation.optimistic;
                p.getMessage().getAttachments();
                codec.getStaticContentType(p);

                ByteArrayBuffer bos = new ByteArrayBuffer();
                com.sun.xml.internal.ws.api.pipe.ContentType ct = codec.encode(p, bos);
                return XMLMessage.createDataSource(ct.getContentType(), bos.newInputStream());
            }
        } catch(Exception ex) {
            throw new WebServiceException(ex);
        }
View Full Code Here

        return null;
    }

    public ContentType encode(Packet packet, OutputStream out) throws IOException {
        //get the current boundary thaat will be reaturned from this method
        ContentType contentType = getContentType(packet);

        if(packet.getMessage() != null){
            try {
                writeln("--"+boundary, out);
                writeln("Content-Id: " + rootId, out);
View Full Code Here

                con.setStatus(responseMessage.isFault()
                        ? HttpURLConnection.HTTP_INTERNAL_ERROR
                        : HttpURLConnection.HTTP_OK);
            }

            ContentType contentType = codec.getStaticContentType(packet);
            if (contentType != null) {
                con.setContentTypeResponseHeader(contentType.getContentType());
                OutputStream os = con.getProtocol().contains("1.1") ? con.getOutput() : new Http10OutputStream(con);
                if (dump) {
                    ByteArrayBuffer buf = new ByteArrayBuffer();
                    codec.encode(packet, buf);
                    dump(buf, "HTTP response " + con.getStatus(), con.getResponseHeaders());
                    buf.writeTo(os);
                } else {
                    codec.encode(packet, os);
                }
                os.close();
            } else {
                ByteArrayBuffer buf = new ByteArrayBuffer();
                contentType = codec.encode(packet, buf);
                con.setContentTypeResponseHeader(contentType.getContentType());
                if (dump) {
                    dump(buf, "HTTP response " + con.getStatus(), con.getResponseHeaders());
                }
                OutputStream os = con.getOutput();
                buf.writeTo(os);
View Full Code Here

        if (hasAttachments) {
            writeln("--"+boundary, out);
            writeln("Content-Type: " + rootCodec.getMimeType(), out);
            writeln(out);
        }
        ContentType primaryCt = rootCodec.encode(packet, out);

        if (hasAttachments) {
            writeln(out);
            // Encode all the attchments
            for (Attachment att : msg.getAttachments()) {
View Full Code Here

    public String getMimeType() {
        return null;
    }

    public ContentType getStaticContentType(Packet packet) {
        ContentType toAdapt = getEncoder(packet).getStaticContentType(packet);
        return (toAdapt != null) ? _adaptingContentType.set(packet, toAdapt) : null;
    }
View Full Code Here

    public String getMimeType() {
        return null;
    }

    public ContentType getStaticContentType(Packet packet) {
        ContentType toAdapt = getEncoder(packet).getStaticContentType(packet);
        return (toAdapt != null) ? _adaptingContentType.set(packet, toAdapt) : null;
    }
View Full Code Here

        return (toAdapt != null) ? _adaptingContentType.set(packet, toAdapt) : null;
    }

    public ContentType encode(Packet packet, OutputStream out) throws IOException {
       preEncode(packet);
       ContentType ct = _adaptingContentType.set(packet, getEncoder(packet).encode(packet, out));
       postEncode();
       return ct;
    }
View Full Code Here

       return ct;
    }

    public ContentType encode(Packet packet, WritableByteChannel buffer) {
        preEncode(packet);
        ContentType ct = _adaptingContentType.set(packet, getEncoder(packet).encode(packet, buffer));
        postEncode();
        return ct;
    }
View Full Code Here

    @Override
    public ContentType getStaticContentType(Packet packet) {
        setRootCodec(packet);

        ContentType ct = null;
        if (packet.getMessage() instanceof MessageDataSource) {
            final MessageDataSource mds = (MessageDataSource)packet.getMessage();
            if (mds.hasUnconsumedDataSource()) {
                ct = getStaticContentType(mds);
                return (ct != null)
View Full Code Here

TOP

Related Classes of com.sun.xml.internal.ws.api.pipe.ContentType

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.