public String getContentType(MessageContext messageContext, OMOutputFormat format, String soapAction) { String encoding = format.getCharSetEncoding(); String contentType; contentType = (String) messageContext.getProperty(Constants.Configuration.CONTENT_TYPE); if (log.isDebugEnabled()) { log.debug("contentType set from messageContext =" + contentType); log.debug("(NOTE) contentType from format is=" + format.getContentType()); } if (contentType == null) { contentType = HTTPConstants.MEDIA_TYPE_APPLICATION_XML; } else if (isSOAPContentType(contentType)) { contentType = HTTPConstants.MEDIA_TYPE_APPLICATION_XML; if (log.isDebugEnabled()) { log.debug("contentType is set incorrectly for Application XML."); log.debug("It is changed to " + contentType); } } if (encoding != null) { contentType += "; charset=" + encoding; } if (log.isDebugEnabled()) { log.debug("contentType returned =" + contentType); } return contentType; }
public String getContentType(MessageContext messageContext, OMOutputFormat format, String soapAction) { String encoding = format.getCharSetEncoding(); String contentType; contentType = (String) messageContext.getProperty(Constants.Configuration.CONTENT_TYPE); if (log.isDebugEnabled()) { log.debug("contentType set from messageContext =" + contentType); log.debug("(NOTE) contentType from format is=" + format.getContentType()); } if (contentType == null) { contentType = HTTPConstants.MEDIA_TYPE_APPLICATION_XML; } else if (isSOAPContentType(contentType)) { contentType = HTTPConstants.MEDIA_TYPE_APPLICATION_XML; if (log.isDebugEnabled()) { log.debug("contentType is set incorrectly for Application XML."); log.debug("It is changed to " + contentType); } } if (encoding != null) { contentType += "; charset=" + encoding; } if (log.isDebugEnabled()) { log.debug("contentType returned =" + contentType); } return contentType; }