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());
}
}
}
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());
}
}
Aggregations