Package org.jibx.ws.codec

Examples of org.jibx.ws.codec.MediaType$Parameter


            connection.setRequestProperty(propertyName, props.getProperty(propertyName));
        }
    }
   
    private static String getContentTypeProperty(MessageProperties props) {
        MediaType contentType = props.getContentType();
        MediaType.Parameter charset = null;
        MediaType.Parameter action = null;
        if (props.getCharset() != null) {
            charset = new MediaType.Parameter(CHARSET_KEY, props.getCharset().toLowerCase());
        }
        if (props.getOperation() != null) {
            action = new MediaType.Parameter(ACTION_KEY, props.getOperation());
        }
        return contentType.toStringWithParams(new MediaType.Parameter[] {charset, action});
    }
View Full Code Here


        }
       
        /** {@inheritDoc} */
        public IXMLReader getReader() throws IOException, WsException {
            if (m_reader == null) {
                MediaType mediaType = getContentMediaType();
                m_buffer = (InByteBuffer)m_inBufferCache.getInstance();
               
                InputStream inputStream;
                if (hasError()) {
                    inputStream = m_connection.getErrorStream();
View Full Code Here

            }
            return m_reader;
        }

        private MediaType getContentMediaType() throws IOException {
            MediaType mediaType = null;
            String ctype = getContentType();
            MediaType contentType;
            if (ctype != null) {
                try {
                    contentType = new MediaType(ctype);
                } catch (ParseException e) {
                    throw new IOException("Unable to parse content-type '" + ctype + "'");
                }
                if (CodecDirectory.hasCodecFor(contentType)) {
                    mediaType = contentType;
View Full Code Here

                Service serv = null;
                try {
                    if (s_logger.isDebugEnabled()) {
                        s_logger.debug("Beginning processing of receive message from " + m_clientAddress);
                    }
                    MediaType mediaType = null;
                    if (m_dimeInput.getPartTypeCode() == DimeCommon.TYPE_MEDIA) {
                        String partTypeText = m_dimeInput.getPartTypeText();
                        try {
                            MediaType partMediaType = new MediaType(partTypeText);
                            if (CodecDirectory.hasCodecFor(partMediaType)) {
                                mediaType = partMediaType;
                            }
                        } catch (ParseException e) {
                            throw new IOException("Unable to parse media type '" + partTypeText + "'");
View Full Code Here

         */
        public IXMLWriter getNormalWriter(String[] uris) throws IOException {
            if (!m_initialized) {
               
                // initialize DIME output first, then hook to writer, so data offset will be past header
                MediaType mediaType = m_codec.getMediaType();
                int typecode = mediaType == null ? DimeCommon.TYPE_NONE : DimeCommon.TYPE_MEDIA;
                m_dimeOutput.nextMessage();
                m_dimeOutput.nextPart(null, typecode, mediaType.toString());
                m_writer = m_codec.getWriter(m_dimeOutput, null, uris);
                initializeWriter(m_writer);
                m_initialized = true;
               
            }
View Full Code Here

   * @param soapAction
   */
  private void assertRequestProperties(MessageProperties properties, String contentType, String charset, String acceptType, String soapAction) throws Exception {
        assertNotNull(properties);
        assertEquals("SOAPAction: ", soapAction, properties.getProperty("SOAPAction"));
        assertEquals("ContentType: ", new MediaType(contentType), properties.getContentType());
        assertEquals("Charset: ", charset, properties.getCharset());
        assertEquals("Accept types length: ", 1, properties.getAcceptTypes().length);
        assertEquals("Accept: ", new MediaType(acceptType), properties.getAcceptTypes()[0]);
  }
View Full Code Here

TOP

Related Classes of org.jibx.ws.codec.MediaType$Parameter

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.