Examples of addDataHandler()


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

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

                    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

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

    @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

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

        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

Examples of org.apache.axis2.jaxws.message.Message.addDataHandler()

                        // Create an Attachment object with the signature value
                        Attachment attachment = new Attachment(returnObject,
                                                               returnType,
                                                               attachmentDesc,
                                                               operationDesc.getResultPartName());
                        m.addDataHandler(attachment.getDataHandler(),
                                         attachment.getContentID());
                        m.setDoingSWA(true);
                    } else {
                        throw ExceptionFactory.
                          makeWebServiceException(Messages.getMessage("pdElementErr"));
View Full Code Here

Examples of org.apache.axis2.jaxws.message.Message.addDataHandler()

                        // Create an Attachment object with the signature value
                        Attachment attachment = new Attachment(returnObject,
                                                               returnType,
                                                               attachmentDesc,
                                                               operationDesc.getResultPartName());
                        m.addDataHandler(attachment.getDataHandler(),
                                         attachment.getContentID());
                        m.setDoingSWA(true);
                    } else {
                        throw ExceptionFactory.
                          makeWebServiceException(Messages.getMessage("pdElementErr"));
View Full Code Here

Examples of org.apache.axis2.jaxws.message.Message.addDataHandler()

        Message m = mc.getMessage();
        if (log.isDebugEnabled()) {
            log.debug("put(" + key + " , " + dh + ")");
        }
        DataHandler old = get(key);
        m.addDataHandler(dh, key);
        m.setDoingSWA(true)// Can't really tell if the attachment is MTOM or SWA, etc.  Mark as SWA to make sure it is written out
        return old;
       
    }
   
View Full Code Here

Examples of org.apache.axis2.jaxws.message.Message.addDataHandler()

        for(String key: t.keySet()) {
            DataHandler dh = t.get(key);
            if (log.isDebugEnabled()) {
                log.debug("addDataHandler via putAll (" + key + " , " + dh + ")");
            }
            m.addDataHandler(dh, key);
            m.setDoingSWA(true)// Can't really tell if the attachment is MTOM or SWA, etc.  Mark as SWA to make sure it is written out
        }
    }
   
    public DataHandler remove(Object key) {
View Full Code Here

Examples of org.apache.axis2.jaxws.message.Message.addDataHandler()

                        // Create an Attachment object with the signature value
                        Attachment attachment = new Attachment(returnObject,
                                                               returnType,
                                                               attachmentDesc,
                                                               operationDesc.getResultPartName());
                        m.addDataHandler(attachment.getDataHandler(),
                                         attachment.getContentID());
                        m.setDoingSWA(true);
                    } else {
                        throw ExceptionFactory.
                          makeWebServiceException(Messages.getMessage("pdElementErr"));
View Full Code Here

Examples of org.apache.axis2.jaxws.message.Message.addDataHandler()

            if (message.countAttachments() > 0) {
                Iterator it = message.getAttachments();
                m.setDoingSWA(true);
                while (it.hasNext()) {
                    AttachmentPart ap = (AttachmentPart)it.next();
                    m.addDataHandler(ap.getDataHandler(), ap.getContentId());
                }
            }
            return m;
        } catch (Exception e) {
            throw ExceptionFactory.makeWebServiceException(e);
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.