public OMMultipartWriter(OutputStream out, OMOutputFormat format) { this.format = format; writer = format.getMultipartWriterFactory().createMultipartWriter(out, format.getMimeBoundary()); useCTEBase64 = format != null && Boolean.TRUE.equals( format.getProperty(OMOutputFormat.USE_CTE_BASE64_FOR_NON_TEXTUAL_ATTACHMENTS)); String soapContentType; if (format.isSOAP11()) { soapContentType = SOAP11Constants.SOAP_11_CONTENT_TYPE; } else { soapContentType = SOAP12Constants.SOAP_12_CONTENT_TYPE; } if (format.isOptimized()) { rootPartContentType = "application/xop+xml; charset=" + format.getCharSetEncoding() + "; type=\"" + soapContentType + "\""; } else { rootPartContentType = soapContentType + "; charset=" + format.getCharSetEncoding(); } }