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

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


     * Since request reached to JSON codec endpoint send response as JSON.
     **/
    /*
     * Read and remove the forced content type don't end in response body part.
     */
    ContentType contentType = (ContentType) invocationProperties.remove(JSONCodec.FORCED_RESPONSE_CONTENT_TYPE);
    /*
     * DEFAULT JSON output
     */
    final HashMap<String, Object>   responseJSONMap = new HashMap<String, Object>();
    final WSJSONWriter         writer       = new WSJSONWriter(output, responseJSONMap, this.codec.getCustomSerializer());
View Full Code Here


        //TODO document more here and increase performance.
        for(BoundEndpoint endPointObj : modules.getBoundEndpoints()){
          if(endPointObj.getEndpoint().getImplementationClass().equals(endpoint.getImplementationClass())
              && endPointObj.getEndpoint().getBinding().getBindingId() != binding.getBindingId()){
            Codec     codec     =  endPointObj.getEndpoint().createCodec();
            ContentType contentType =   codec.getStaticContentType(packet);
            if(contentType != null && contentType.getContentType().startsWith(packet.invocationProperties.get("accept").toString())){
              return endPointObj.getEndpoint().createCodec().getStaticContentType(packet);
            }
          }
        }
      }
View Full Code Here

    public ContentType getStaticContentType(Packet packet) {
        return getStaticContentTypeStatic(packet, version);
    }
   
    public static ContentType getStaticContentTypeStatic(Packet packet, SOAPVersion version) {
        ContentType ct = (ContentType) packet.getInternalContentType();
        if ( ct != null ) return ct;

        String uuid = UUID.randomUUID().toString();
        String boundary = "uuid:" + uuid;
        String rootId = "<rootpart*"+uuid+"@example.jaxws.sun.com>";
 
View Full Code Here

        String rootId = ctImpl.getRootId();
        boolean hasAttachments = (boundary != null);
        Codec rootCodec = getMimeRootCodec(packet);
        if (hasAttachments) {
            writeln("--"+boundary, out);
            ContentType ct = rootCodec.getStaticContentType(packet);
            String ctStr = (ct != null) ? ct.getContentType() : rootCodec.getMimeType();
            if (rootId != null) writeln("Content-ID: " + rootId, out);
            writeln("Content-Type: " + ctStr, 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 ContentType getStaticContentType(Packet packet) {
        ContentType ct = (ContentType) packet.getInternalContentType();
        if ( ct != null ) return ct;
        Message msg = packet.getMessage();
        boolean hasAttachments = !msg.getAttachments().isEmpty();
        Codec rootCodec = getMimeRootCodec(packet);
View Full Code Here

            return null;
        }

        if (hasAttachments) {
            writeln("--"+boundary, out);
            ContentType ct = rootCodec.getStaticContentType(packet);
            String ctStr = (ct != null) ? ct.getContentType() : rootCodec.getMimeType();
            writeln("Content-Type: " + ctStr, 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

        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

    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

TOP

Related Classes of com.sun.xml.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.