public String getMimeBoundary() { return format.getMimeBoundary(); }
public String getContentTypeForSwA(String SOAPContentType) { StringBuffer sb = new StringBuffer(); sb.append("multipart/related"); sb.append("; "); sb.append("boundary="); // The value of the boundary parameter must be enclosed in double quotation // marks, according to the Basic Profile 2.0 Specification, Rule R1109: // "Parameters on the Content-Type MIME header field-value in a request // MESSAGE MUST be a quoted string." sb.append("\""); sb.append(getMimeBoundary()); sb.append("\""); sb.append("; "); sb.append("type=\"").append(SOAPContentType).append("\""); sb.append("; "); sb.append("start=\"<").append(getRootContentId()).append(">\""); return sb.toString(); }
/** * Different message formats can set their own content types * Eg: JSONFormatter can set the content type as application/json * * @param messageContext * @param format * @param soapAction */ public String getContentType(MessageContext messageContext, OMOutputFormat format, String soapAction) { String contentType = HTTPConstants.MEDIA_TYPE_MULTIPART_FORM_DATA; String encoding = format.getCharSetEncoding(); if (encoding != null) { contentType += "; charset=" + encoding; } contentType = contentType + "; " + "boundary=" + format.getMimeBoundary(); return contentType; }
/** * Different message formats can set their own content types * Eg: JSONFormatter can set the content type as application/json * * @param messageContext * @param format * @param soapAction */ public String getContentType(MessageContext messageContext, OMOutputFormat format, String soapAction) { String contentType = HTTPConstants.MEDIA_TYPE_MULTIPART_FORM_DATA; String encoding = format.getCharSetEncoding(); if (encoding != null) { contentType += "; charset=" + encoding; } contentType = contentType + "; " + "boundary=" + format.getMimeBoundary(); return contentType; }
sb.append(getMimeBoundary()); sb.append("\""); sb.append("; ");
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(); } }