本文整理汇总了Java中org.apache.axiom.om.OMOutputFormat.setMimeBoundary方法的典型用法代码示例。如果您正苦于以下问题:Java OMOutputFormat.setMimeBoundary方法的具体用法?Java OMOutputFormat.setMimeBoundary怎么用?Java OMOutputFormat.setMimeBoundary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axiom.om.OMOutputFormat
的用法示例。
在下文中一共展示了OMOutputFormat.setMimeBoundary方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOMOutputFormat
import org.apache.axiom.om.OMOutputFormat; //导入方法依赖的package包/类
/**
* Get the OMOutput format for the given message
* @param msgContext the axis message context
* @return the OMOutput format to be used
*/
public static OMOutputFormat getOMOutputFormat(MessageContext msgContext) {
OMOutputFormat format = new OMOutputFormat();
msgContext.setDoingMTOM(TransportUtils.doWriteMTOM(msgContext));
msgContext.setDoingSwA(TransportUtils.doWriteSwA(msgContext));
msgContext.setDoingREST(TransportUtils.isDoingREST(msgContext));
format.setSOAP11(msgContext.isSOAP11());
format.setDoOptimize(msgContext.isDoingMTOM());
format.setDoingSWA(msgContext.isDoingSwA());
format.setCharSetEncoding(TransportUtils.getCharSetEncoding(msgContext));
Object mimeBoundaryProperty = msgContext.getProperty(Constants.Configuration.MIME_BOUNDARY);
if (mimeBoundaryProperty != null) {
format.setMimeBoundary((String) mimeBoundaryProperty);
}
return format;
}
示例2: encode
import org.apache.axiom.om.OMOutputFormat; //导入方法依赖的package包/类
public byte[] encode(ClientOptions options, XMLMessage message) throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OMOutputFormat outputFormat = new OMOutputFormat();
outputFormat.setCharSetEncoding(options.getCharset());
outputFormat.setIgnoreXMLDeclaration(true);
if (message.getType() == XMLMessage.Type.SWA) {
outputFormat.setMimeBoundary(options.getMimeBoundary());
outputFormat.setRootContentId(options.getRootContentId());
StringWriter writer = new StringWriter();
message.getMessageElement().serializeAndConsume(writer);
MIMEOutputUtils.writeSOAPWithAttachmentsMessage(writer, baos, message.getAttachments(), outputFormat);
} else {
message.getMessageElement().serializeAndConsume(baos, outputFormat);
}
return baos.toByteArray();
}
示例3: getContentType
import org.apache.axiom.om.OMOutputFormat; //导入方法依赖的package包/类
public ContentType getContentType(ClientOptions options, ContentType contentType) throws Exception {
if (contentType.getBaseType().equals(XMLMessage.Type.SWA.getContentType().getBaseType())) {
OMOutputFormat outputFormat = new OMOutputFormat();
outputFormat.setMimeBoundary(options.getMimeBoundary());
outputFormat.setRootContentId(options.getRootContentId());
return new ContentType(outputFormat.getContentTypeForSwA(SOAP12Constants.SOAP_12_CONTENT_TYPE));
} else {
return ContentTypeUtil.addCharset(contentType, options.getCharset());
}
}