Search in sources :

Example 1 with Attachment

use of org.springframework.ws.mime.Attachment in project camel by apache.

the class SpringWebserviceConsumer method extractAttachmentsFromRequest.

private void extractAttachmentsFromRequest(final WebServiceMessage request, final SpringWebserviceMessage inMessage) {
    if (request instanceof MimeMessage) {
        Iterator<Attachment> attachmentsIterator = ((MimeMessage) request).getAttachments();
        while (attachmentsIterator.hasNext()) {
            Attachment attachment = attachmentsIterator.next();
            inMessage.addAttachment(attachment.getContentId(), attachment.getDataHandler());
        }
    }
}
Also used : MimeMessage(org.springframework.ws.mime.MimeMessage) Attachment(org.springframework.ws.mime.Attachment)

Example 2 with Attachment

use of org.springframework.ws.mime.Attachment in project camel by apache.

the class SpringWebserviceProducer method populateMessageAttachmentsFromResponse.

/**
     * Populates message attachments from soap response attachments 
     * @param inOrOut {@link Message}
     * @param soapMessage {@link SoapMessage}
     */
private void populateMessageAttachmentsFromResponse(Message inOrOut, Iterator<Attachment> attachments) {
    while (attachments.hasNext()) {
        Attachment attachment = attachments.next();
        inOrOut.getAttachments().put(attachment.getContentId(), attachment.getDataHandler());
    }
}
Also used : Attachment(org.springframework.ws.mime.Attachment)

Aggregations

Attachment (org.springframework.ws.mime.Attachment)2 MimeMessage (org.springframework.ws.mime.MimeMessage)1