Examples of AttachmentDataSource


Examples of com.eviware.soapui.impl.wsdl.submit.transports.http.support.attachments.AttachmentDataSource

            part.setDisposition( "form-data; name=\"" + name + "\"; filename=\"" + attachment.getName() + "\"" );
          }
          else
            part.setDisposition( "form-data; name=\"" + attachment.getName() + "\"" );

          part.setDataHandler( new DataHandler( new AttachmentDataSource( attachment ) ) );

          formMp.addBodyPart( part );
        }

        MimeMessage message = new MimeMessage( AttachmentUtils.JAVAMAIL_SESSION );
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.submit.transports.http.support.attachments.AttachmentDataSource

      {
        for( Attachment attachment : request.getAttachments() )
        {
          if( attachment.getName().equals( fileName ) )
          {
            part.setDataHandler( new DataHandler( new AttachmentDataSource( attachment ) ) );
            break;
          }
        }
      }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.submit.transports.http.support.attachments.AttachmentDataSource

                        part.setDisposition("form-data; name=\"" + name + "\"; filename=\"" + attachment.getName() + "\"");
                    } else {
                        part.setDisposition("form-data; name=\"" + attachment.getName() + "\"");
                    }

                    part.setDataHandler(new DataHandler(new AttachmentDataSource(attachment)));

                    formMp.addBodyPart(part);
                }

                MimeMessage message = new MimeMessage(AttachmentUtils.JAVAMAIL_SESSION);
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.submit.transports.http.support.attachments.AttachmentDataSource

            if (file.exists()) {
                part.setDataHandler(new DataHandler(new FileDataSource(file)));
            } else {
                for (Attachment attachment : request.getAttachments()) {
                    if (attachment.getName().equals(fileName)) {
                        part.setDataHandler(new DataHandler(new AttachmentDataSource(attachment)));
                        break;
                    }
                }
            }
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentDataSource

            // add output attachments
            map = CastUtils.cast((Map<?, ?>)ctx.getMessageContext().get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS));

            try {
                DataSource ds = new AttachmentDataSource("image/jpeg", getClass().getResourceAsStream("/Splash.jpg"));
                map.put(MtomTestHelper.RESP_IMAGE_CID, new DataHandler(ds));
               
            } catch (IOException e) {
                e.printStackTrace();
            }
           
            try {
                DataSource ds = new AttachmentDataSource("application/octet-stream",
                                                         new ByteArrayInputStream(MtomTestHelper.RESP_PHOTO_DATA));
                map.put(MtomTestHelper.RESP_PHOTO_CID, new DataHandler(ds));
               
            } catch (IOException e) {
                e.printStackTrace();
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentDataSource

            // add output attachments
            map = (Map) ctx.getMessageContext().get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);

            try {
                DataSource ds = new AttachmentDataSource("image/jpeg", getClass().getResourceAsStream("/Splash.jpg"));
                map.put(MtomTestHelper.RESP_IMAGE_CID, new DataHandler(ds));
               
            } catch (IOException e) {
                e.printStackTrace();
            }
           
            try {
                DataSource ds = new AttachmentDataSource("application/octet-stream",
                                                         new ByteArrayInputStream(MtomTestHelper.RESP_PHOTO_DATA));
                map.put(MtomTestHelper.RESP_PHOTO_CID, new DataHandler(ds));
               
            } catch (IOException e) {
                e.printStackTrace();
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentDataSource

        Object en = message.getContextualProperty(Message.SCHEMA_VALIDATION_ENABLED);
        if ((Boolean.TRUE.equals(en) || "true".equals(en)) && message.getAttachments() != null) {
            Collection<AttachmentDataSource> dss = new ArrayList<AttachmentDataSource>();
            for (Attachment at : message.getAttachments()) {
                if (at.getDataHandler().getDataSource() instanceof AttachmentDataSource) {
                    AttachmentDataSource ds = (AttachmentDataSource)at.getDataHandler().getDataSource();
                    try {
                        ds.hold();
                    } catch (IOException e) {
                        throw new Fault(e);
                    }
                    dss.add(ds);
                }
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentDataSource

            // add output attachments
            map = (Map) ctx.getMessageContext().get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);

            try {
                DataSource ds = new AttachmentDataSource("image/jpeg", getClass().getResourceAsStream("/Splash.jpg"));
                map.put(MtomTestHelper.RESP_IMAGE_CID, new DataHandler(ds));
               
            } catch (IOException e) {
                e.printStackTrace();
            }
           
            try {
                DataSource ds = new AttachmentDataSource("application/octet-stream",
                                                         new ByteArrayInputStream(MtomTestHelper.RESP_PHOTO_DATA));
                map.put(MtomTestHelper.RESP_PHOTO_CID, new DataHandler(ds));
               
            } catch (IOException e) {
                e.printStackTrace();
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentDataSource

        Object en = message.getContextualProperty(Message.SCHEMA_VALIDATION_ENABLED);
        if ((Boolean.TRUE.equals(en) || "true".equals(en)) && message.getAttachments() != null) {
            Collection<AttachmentDataSource> dss = new ArrayList<AttachmentDataSource>();
            for (Attachment at : message.getAttachments()) {
                if (at.getDataHandler().getDataSource() instanceof AttachmentDataSource) {
                    AttachmentDataSource ds = (AttachmentDataSource)at.getDataHandler().getDataSource();
                    try {
                        ds.hold();
                    } catch (IOException e) {
                        throw new Fault(e);
                    }
                    dss.add(ds);
                }
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentDataSource

        Object en = message.getContextualProperty(Message.SCHEMA_VALIDATION_ENABLED);
        if ((Boolean.TRUE.equals(en) || "true".equals(en)) && message.getAttachments() != null) {
            Collection<AttachmentDataSource> dss = new ArrayList<AttachmentDataSource>();
            for (Attachment at : message.getAttachments()) {
                if (at.getDataHandler().getDataSource() instanceof AttachmentDataSource) {
                    AttachmentDataSource ds = (AttachmentDataSource)at.getDataHandler().getDataSource();
                    try {
                        ds.hold(message);
                    } catch (IOException e) {
                        throw new Fault(e);
                    }
                    dss.add(ds);
                }
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.