/** * Creates an AttachmentPart object and populates it using the given DataHandler object. * @param datahandler the javax.activation.DataHandler object that will generate the content for this SOAPMessage object * @return a new AttachmentPart object that contains data generated by the given DataHandler object */ public AttachmentPart createAttachmentPart(DataHandler datahandler) { AttachmentPart part = createAttachmentPart(); part.setDataHandler(datahandler); return part; }
/** * Creates an <CODE>AttachmentPart</CODE> object and populates it using the given * <CODE>DataHandler</CODE> object. * * @param datahandler the <CODE> javax.activation.DataHandler</CODE> object that will generate * the content for this <CODE>SOAPMessage</CODE> object * @return a new <CODE>AttachmentPart</CODE> object that contains data generated by the given * <CODE> DataHandler</CODE> object * @throws IllegalArgumentException * if there was a problem with the specified <CODE> DataHandler</CODE> object * @see DataHandler DataHandler * @see javax.activation.DataContentHandler DataContentHandler */ public AttachmentPart createAttachmentPart(DataHandler datahandler) { AttachmentPart attachmentpart = createAttachmentPart(); attachmentpart.setDataHandler(datahandler); return attachmentpart; }
/** * Creates an {@code AttachmentPart} object and populates it using * the given {@code DataHandler} object. * * @param dataHandler * the {@code javax.activation.DataHandler} object that * will generate the content for this {@code SOAPMessage} * object * @return a new {@code AttachmentPart} object that contains data * generated by the given {@code DataHandler} object * @exception IllegalArgumentException * if there was a problem with the specified {@code DataHandler} * object * @see javax.activation.DataHandler * @see javax.activation.DataContentHandler */ public AttachmentPart createAttachmentPart(DataHandler dataHandler) { AttachmentPart attachment = createAttachmentPart(); attachment.setDataHandler(dataHandler); return attachment; }
/** * Creates an {@code AttachmentPart} object and populates it using * the given {@code DataHandler} object. * * @param dataHandler * the {@code javax.activation.DataHandler} object that * will generate the content for this {@code SOAPMessage} * object * @return a new {@code AttachmentPart} object that contains data * generated by the given {@code DataHandler} object * @exception IllegalArgumentException * if there was a problem with the specified {@code DataHandler} * object * @see javax.activation.DataHandler * @see javax.activation.DataContentHandler */ public AttachmentPart createAttachmentPart(DataHandler dataHandler) { AttachmentPart attachment = createAttachmentPart(); attachment.setDataHandler(dataHandler); return attachment; }
/** * Creates an {@code AttachmentPart} object and populates it using * the given {@code DataHandler} object. * * @param dataHandler * the {@code javax.activation.DataHandler} object that * will generate the content for this {@code SOAPMessage} * object * @return a new {@code AttachmentPart} object that contains data * generated by the given {@code DataHandler} object * @exception IllegalArgumentException * if there was a problem with the specified {@code DataHandler} * object * @see javax.activation.DataHandler * @see javax.activation.DataContentHandler */ public AttachmentPart createAttachmentPart(DataHandler dataHandler) { AttachmentPart attachment = createAttachmentPart(); attachment.setDataHandler(dataHandler); return attachment; }
/** * Creates an <code>AttachmentPart</code> object and populates it using * the given <code>DataHandler</code> object. * * @param dataHandler * the <code>javax.activation.DataHandler</code> object that * will generate the content for this <code>SOAPMessage</code> * object * @return a new <code>AttachmentPart</code> object that contains data * generated by the given <code>DataHandler</code> object * @exception IllegalArgumentException * if there was a problem with the specified <code>DataHandler</code> * object * @see javax.activation.DataHandler * @see javax.activation.DataContentHandler */ public AttachmentPart createAttachmentPart(DataHandler dataHandler) { AttachmentPart attachment = createAttachmentPart(); attachment.setDataHandler(dataHandler); return attachment; }
/** * Creates an <code>AttachmentPart</code> object and populates it using * the given <code>DataHandler</code> object. * * @param dataHandler * the <code>javax.activation.DataHandler</code> object that * will generate the content for this <code>SOAPMessage</code> * object * @return a new <code>AttachmentPart</code> object that contains data * generated by the given <code>DataHandler</code> object * @exception IllegalArgumentException * if there was a problem with the specified <code>DataHandler</code> * object * @see javax.activation.DataHandler * @see javax.activation.DataContentHandler */ public AttachmentPart createAttachmentPart(DataHandler dataHandler) { AttachmentPart attachment = createAttachmentPart(); attachment.setDataHandler(dataHandler); return attachment; }
@Override public void writeTo(SOAPMessage saaj) throws SOAPException { saaj.createAttachmentPart().setDataHandler(asDataHandler()); }
@Override public void writeTo(SOAPMessage saaj) throws SOAPException { saaj.createAttachmentPart().setDataHandler(asDataHandler()); }
@Override public void writeTo(SOAPMessage saaj) throws SOAPException { saaj.createAttachmentPart().setDataHandler(asDataHandler()); }
public void writeTo(SOAPMessage saaj) throws SOAPException { AttachmentPart part = saaj.createAttachmentPart(); part.setDataHandler(dh); part.setContentId(contentId); saaj.addAttachmentPart(part); } }
public void writeTo(SOAPMessage saaj) throws SOAPException { AttachmentPart part = saaj.createAttachmentPart(); part.setDataHandler(dh); part.setContentId(contentId); saaj.addAttachmentPart(part); } }
public void writeTo(SOAPMessage saaj) throws SOAPException { AttachmentPart part = saaj.createAttachmentPart(); part.setDataHandler(dh); part.setContentId(contentId); saaj.addAttachmentPart(part); } }
@Override public void writeTo(SOAPMessage saaj) throws SOAPException { AttachmentPart part = saaj.createAttachmentPart(); part.setDataHandler(asDataHandler()); part.setContentId(contentId); saaj.addAttachmentPart(part); }
public void writeTo(SOAPMessage saaj) throws SOAPException { AttachmentPart part = saaj.createAttachmentPart(); part.setDataHandler(asDataHandler()); part.setContentId(contentId); saaj.addAttachmentPart(part); }
public void writeTo(SOAPMessage saaj) throws SOAPException { AttachmentPart part = saaj.createAttachmentPart(); part.setDataHandler(asDataHandler()); part.setContentId(contentId); saaj.addAttachmentPart(part); }
public void writeTo(SOAPMessage saaj) throws SOAPException { AttachmentPart part = saaj.createAttachmentPart(); part.setDataHandler(asDataHandler()); part.setContentId(contentId); saaj.addAttachmentPart(part); }
@Override public void writeTo(SOAPMessage saaj) throws SOAPException { AttachmentPart part = saaj.createAttachmentPart(); part.setDataHandler(asDataHandler()); part.setContentId(contentId); saaj.addAttachmentPart(part); }
@Override public void writeTo(SOAPMessage saaj) throws SOAPException { AttachmentPart part = saaj.createAttachmentPart(); part.setDataHandler(asDataHandler()); part.setContentId(contentId); saaj.addAttachmentPart(part); }
public SOAPMessage sendMessage() throws Exception { SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance(); SOAPConnection connection = conFactory.createConnection(); MessageFactory msgFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL); SOAPMessage msg = msgFactory.createMessage(); SOAPBodyElement bodyElement = msg.getSOAPBody().addBodyElement(new QName("urn:switchyard-quickstart:soap-attachment:1.0", "echoImage")); bodyElement.addTextNode("cid:switchyard.png"); // CXF does not set content-type. msg.getMimeHeaders().addHeader("Content-Type", "multipart/related; type=\"text/xml\"; start=\"<root.message@cxf.apache.org>\""); msg.getSOAPPart().setContentId("<root.message@cxf.apache.org>"); AttachmentPart ap = msg.createAttachmentPart(); ap.setDataHandler(new DataHandler(new StreamDataSource())); ap.setContentId("<switchyard.png>"); msg.addAttachmentPart(ap); return connection.call(msg, new URL(SWITCHYARD_WEB_SERVICE)); }