Package org.apache.axiom.attachments

Examples of org.apache.axiom.attachments.Attachments.addDataHandler()


                    if (!SAAJUtil.compareContentTypes(attachment.getContentType(), handler.getContentType())) {
                        ConfigurableDataHandler configuredHandler = new ConfigurableDataHandler(handler.getDataSource());
                        configuredHandler.setContentType(attachment.getContentType());
                        handler = configuredHandler;
                    }
                    attachments.addDataHandler(contentId, handler);
                }
                options.setProperty(Constants.Configuration.ENABLE_SWA, Constants.VALUE_TRUE);
            }
        }
       
View Full Code Here


                    outMessage.setEnvelope(inMessage.getEnvelope());
                    Attachments inAttachments = inMessage.getAttachmentMap();
                    Attachments outAttachments = outMessage.getAttachmentMap();
                    for (String contentId : inAttachments.getAllContentIDs()) {
                        if (!contentId.equals(inAttachments.getRootPartContentID())) {
                            outAttachments.addDataHandler(contentId,
                                    inAttachments.getDataHandler(contentId));
                        }
                    }
                    outMessage.setDoingSwA(inMessage.isDoingSwA());
                    outMessage.setDoingMTOM(inMessage.isDoingMTOM());
View Full Code Here

    @Override
    protected XMLMessage prepareMessage() throws Exception {
        OMFactory factory = OMAbstractFactory.getOMFactory();
        OMElement payload = factory.createOMElement(new QName("root"));
        Attachments attachments = new Attachments();
        attachments.addDataHandler(contentID, new DataHandler(new ByteArrayDataSource(attachmentContent, "application/octet-stream")));
        return new XMLMessage(payload, XMLMessage.Type.SWA, attachments);
    }

    @Override
    protected void checkMessageData(XMLMessage expected, XMLMessage actual) throws Exception {
View Full Code Here

        outMessage.setEnvelope(inMessage.getEnvelope());
        Attachments inAttachments = inMessage.getAttachmentMap();
        Attachments outAttachments = outMessage.getAttachmentMap();
        for (String contentId : inAttachments.getAllContentIDs()) {
            if (!contentId.equals(inAttachments.getRootPartContentID())) {
                outAttachments.addDataHandler(contentId,
                        inAttachments.getDataHandler(contentId));
            }
        }
        outMessage.setDoingSwA(inMessage.isDoingSwA());
        outMessage.setDoingMTOM(inMessage.isDoingMTOM());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.