Package javax.xml.soap

Examples of javax.xml.soap.AttachmentPart.addMimeHeader()


        request.addAttachmentPart(textAttach);

        //Attach a java.awt.Image object to the SOAP request
        DataHandler imageDH = new DataHandler(TestUtils.getTestFileAsDataSource("axis2.jpg"));
        AttachmentPart jpegAttach = request.createAttachmentPart(imageDH);
        jpegAttach.addMimeHeader("Content-Transfer-Encoding", "binary");
        jpegAttach.setContentId("submitSampleImage@apache.org");
        jpegAttach.setContentType("image/jpg");
        request.addAttachmentPart(jpegAttach);

        SOAPConnection sCon = SOAPConnectionFactory.newInstance().createConnection();
View Full Code Here


      QName xmlName = new QName(elementNamespace, elementLocalName);
      if(log.isDebugEnabled()) log.debug("serialize: [xmlName=" + xmlName + "]");

      String cid = soapMessage.getCidGenerator().generateFromName(xmlName.getLocalPart());
      AttachmentPart xopPart = soapMessage.createAttachmentPart(data);
      xopPart.addMimeHeader(MimeConstants.CONTENT_ID, '<' + cid + '>'); // RFC2392 requirement
      soapMessage.addAttachmentPart(xopPart);

      if(log.isDebugEnabled()) log.debug("Created attachment part " + cid + ", with content-type " + xopPart.getContentType());

      return "cid:" + cid;
View Full Code Here

      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();

      String cid = soapMessage.getCidGenerator().generateFromCount();
      AttachmentPart swaRefPart = soapMessage.createAttachmentPart(dataHandler);
      swaRefPart.addMimeHeader(MimeConstants.CONTENT_ID, '<' + cid + '>'); // RFC2392 requirement
      soapMessage.addAttachmentPart(swaRefPart);

      if(log.isDebugEnabled()) log.debug("Created attachment part " + cid + ", with content-type " + swaRefPart.getContentType());

      return "cid:" + cid;
View Full Code Here

      String cid = soapMessage.getCidGenerator().generateFromName(xmlName.getLocalPart());

      DataHandler dataHandler = XOPContext.createDataHandler(obj);
      AttachmentPart xopPart = soapMessage.createAttachmentPart(dataHandler);
      xopPart.addMimeHeader(MimeConstants.CONTENT_ID, '<'+cid+'>'); // RFC2392 requirement
      soapMessage.addAttachmentPart(xopPart);

      if(log.isDebugEnabled()) log.debug("Created attachment part " +cid+", with content-type " +xopPart.getContentType());

      return "cid:" + cid;
View Full Code Here

                    ap.setContentId(a.getId());
                    Iterator<String> i = a.getHeaderNames();
                    while (i != null && i.hasNext()) {
                        String h = i.next();
                        String val = a.getHeader(h);
                        ap.addMimeHeader(h, val);
                    }
                    soapMessage.addAttachmentPart(ap);
                }
            }
           
View Full Code Here

                Iterator<AttachmentEx.MimeHeader> imh = ax.getMimeHeaders();
                while (imh.hasNext()) {
                    AttachmentEx.MimeHeader ame = imh.next();
                    if ((!"Content-ID".equals(ame.getName()))
                            && (!"Content-Type".equals(ame.getName())))
                        part.addMimeHeader(ame.getName(), ame.getValue());
                }
            }
            msg.addAttachmentPart(part);
        }   
    }
View Full Code Here

      QName xmlName = new QName(elementNamespace, elementLocalName);
      if(log.isDebugEnabled()) log.debug("serialize: [xmlName=" + xmlName + "]");

      String cid = soapMessage.getCidGenerator().generateFromName(xmlName.getLocalPart());
      AttachmentPart xopPart = soapMessage.createAttachmentPart(data);
      xopPart.addMimeHeader(MimeConstants.CONTENT_ID, '<' + cid + '>'); // RFC2392 requirement
      soapMessage.addAttachmentPart(xopPart);

      if(log.isDebugEnabled()) log.debug("Created attachment part " + cid + ", with content-type " + xopPart.getContentType());

      return "cid:" + cid;
View Full Code Here

      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();

      String cid = soapMessage.getCidGenerator().generateFromCount();
      AttachmentPart swaRefPart = soapMessage.createAttachmentPart(dataHandler);
      swaRefPart.addMimeHeader(MimeConstants.CONTENT_ID, '<' + cid + '>'); // RFC2392 requirement
      soapMessage.addAttachmentPart(swaRefPart);

      if(log.isDebugEnabled()) log.debug("Created attachment part " + cid + ", with content-type " + swaRefPart.getContentType());

      return "cid:" + cid;
View Full Code Here

/*     */
/*  73 */     String cid = soapMessage.getCidGenerator().generateFromName(xmlName.getLocalPart());
/*     */
/*  75 */     DataHandler dataHandler = XOPContext.createDataHandler(obj);
/*  76 */     AttachmentPart xopPart = soapMessage.createAttachmentPart(dataHandler);
/*  77 */     xopPart.addMimeHeader("Content-Id", '<' + cid + '>');
/*  78 */     soapMessage.addAttachmentPart(xopPart);
/*     */
/*  80 */     if (log.isDebugEnabled()) log.debug("Created attachment part " + cid + ", with content-type " + xopPart.getContentType());
/*     */
/*  82 */     return "cid:" + cid;
View Full Code Here

/*  80 */     QName xmlName = new QName(elementNamespace, elementLocalName);
/*  81 */     if (log.isDebugEnabled()) log.debug("serialize: [xmlName=" + xmlName + "]");
/*     */
/*  83 */     String cid = soapMessage.getCidGenerator().generateFromName(xmlName.getLocalPart());
/*  84 */     AttachmentPart xopPart = soapMessage.createAttachmentPart(data);
/*  85 */     xopPart.addMimeHeader("Content-Id", '<' + cid + '>');
/*  86 */     soapMessage.addAttachmentPart(xopPart);
/*     */
/*  88 */     if (log.isDebugEnabled()) log.debug("Created attachment part " + cid + ", with content-type " + xopPart.getContentType());
/*     */
/*  90 */     return "cid:" + cid;
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.