Examples of writePart()


Examples of org.apache.axiom.mime.MultipartWriter.writePart()

        SOAPEnvelope envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
        envelope.getBody().addChild(ADBBeanUtil.getOMElement(bean));
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        OMOutputFormat format = new OMOutputFormat();
        MultipartWriter mpWriter = JavaMailMultipartWriterFactory.INSTANCE.createMultipartWriter(buffer, format.getMimeBoundary());
        OutputStream rootPartWriter = mpWriter.writePart("application/xop+xml; charset=UTF-8; type=\"text/xml\"", "binary", format.getRootContentId());
        envelope.serialize(rootPartWriter, format);
        rootPartWriter.close();
        mpWriter.complete();
//        System.out.write(buffer.toByteArray());
        String contentType = format.getContentTypeForMTOM("text/xml");
View Full Code Here

Examples of org.apache.axiom.mime.MultipartWriter.writePart()

        SOAPEnvelope envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
        envelope.getBody().addChild(ADBBeanUtil.getOMElement(bean));
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        OMOutputFormat format = new OMOutputFormat();
        MultipartWriter mpWriter = JavaMailMultipartWriterFactory.INSTANCE.createMultipartWriter(buffer, format.getMimeBoundary());
        OutputStream rootPartWriter = mpWriter.writePart("application/xop+xml; charset=UTF-8; type=\"text/xml\"", "binary", format.getRootContentId());
        envelope.serialize(rootPartWriter, format);
        rootPartWriter.close();
        mpWriter.complete();
//        System.out.write(buffer.toByteArray());
        String contentType = format.getContentTypeForMTOM("text/xml");
View Full Code Here

Examples of org.apache.axiom.mime.MultipartWriter.writePart()

        SOAPEnvelope envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
        envelope.getBody().addChild(ADBBeanUtil.getOMElement(bean));
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        OMOutputFormat format = new OMOutputFormat();
        MultipartWriter mpWriter = AxiomMultipartWriterFactory.INSTANCE.createMultipartWriter(buffer, format.getMimeBoundary());
        OutputStream rootPartWriter = mpWriter.writePart("application/xop+xml; charset=UTF-8; type=\"text/xml\"", "binary", format.getRootContentId());
        envelope.serialize(rootPartWriter, format);
        rootPartWriter.close();
        mpWriter.complete();
//        System.out.write(buffer.toByteArray());
        String contentType = format.getContentTypeForMTOM("text/xml");
View Full Code Here

Examples of org.apache.axiom.om.impl.OMMultipartWriter.writePart()

        rootPartWriter.write(writer.toString());
        rootPartWriter.close();

        // Get the collection of ids associated with the attachments
        for (String id: attachments.getAllContentIDs()) {
          mpw.writePart(attachments.getDataHandler(id), id);
        }

        mpw.complete();
      }
      catch (IOException ex) {
View Full Code Here

Examples of org.apache.axiom.om.impl.OMMultipartWriter.writePart()

                DataHandler rootDataHandler = new DataHandler(busObject);
                if (!rootDataHandler.getContentType().equals(contentType)) {
                    rootDataHandler = new WrappedDataHandler(rootDataHandler, contentType);
                }
                try {
                    mpw.writePart(rootDataHandler, format.getRootContentId());
                    for (String cid : attachments.keySet()) {
                        mpw.writePart(attachments.get(cid), cid);
                    }
                    mpw.complete();
                    outputStream.flush();
View Full Code Here

Examples of org.apache.axiom.om.impl.OMMultipartWriter.writePart()

                    rootDataHandler = new WrappedDataHandler(rootDataHandler, contentType);
                }
                try {
                    mpw.writePart(rootDataHandler, format.getRootContentId());
                    for (String cid : attachments.keySet()) {
                        mpw.writePart(attachments.get(cid), cid);
                    }
                    mpw.complete();
                    outputStream.flush();
                } catch (IOException ex) {
                    throw AxisFault.makeFault(ex);
View Full Code Here

Examples of org.apache.axiom.om.impl.OMMultipartWriter.writePart()

                OMMultipartWriter mpw = new OMMultipartWriter(out, format);
                OutputStream rootPartOutputStream = mpw.writeRootPart();
                envelope.serialize(rootPartOutputStream);
                rootPartOutputStream.close();
                for (AttachmentPart ap : attachmentParts) {
                    mpw.writePart(ap.getDataHandler(), ap.getContentId());
                }
                mpw.complete();
            }

            saveRequired = true;
View Full Code Here

Examples of org.apache.axiom.om.impl.OMMultipartWriter.writePart()

                attachmentsWriter = new OMMultipartWriter(innerOutputStream, innerFormat);
            }
           
            Attachments attachments = msgCtxt.getAttachmentMap();
            for (String contentID : attachments.getAllContentIDs()) {
                attachmentsWriter.writePart(attachments.getDataHandler(contentID), contentID);
            }
           
            if (MM7CompatMode) {
                attachmentsWriter.complete();
                innerOutputStream.close();
View Full Code Here

Examples of org.apache.axiom.om.impl.OMMultipartWriter.writePart()

                OMMultipartWriter mpw = new OMMultipartWriter(out, format);
                OutputStream rootPartOutputStream = mpw.writeRootPart();
                envelope.serialize(rootPartOutputStream);
                rootPartOutputStream.close();
                for (AttachmentPart ap : attachmentParts) {
                    mpw.writePart(ap.getDataHandler(), ap.getContentId());
                }
                mpw.complete();
            }
            saveChanges();
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.axiom.om.impl.OMMultipartWriter.writePart()

                OMMultipartWriter mpw = new OMMultipartWriter(out, format);
                OutputStream rootPartOutputStream = mpw.writeRootPart();
                envelope.serialize(rootPartOutputStream);
                rootPartOutputStream.close();
                for (AttachmentPart ap : attachmentParts) {
                    mpw.writePart(ap.getDataHandler(), ap.getContentId());
                }
                mpw.complete();
            }

            saveRequired = true;
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.