当前位置: 首页>>代码示例>>Java>>正文


Java OMOutputFormat.setMimeBoundary方法代码示例

本文整理汇总了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;
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:23,代码来源:BaseUtils.java

示例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();
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:17,代码来源:MessageEncoder.java

示例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());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:11,代码来源:MessageEncoder.java


注:本文中的org.apache.axiom.om.OMOutputFormat.setMimeBoundary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。