views:

47

answers:

1

The soap message successfully comes across, and I can print out the envelope just fine, but the attachments are always zero. Even though I put the exact request through SoapUI, and the attachments show up fine in that. Maybe this isn't a valid way to extract the attachments. I'm adding this to the sendandreceive method.

private class AttachmentWebServiceMessageExtractorImpl implements WebServiceMessageExtractor {
    public Object extractData(WebServiceMessage webServiceMessage) throws IOException, TransformerException {
        Set<ZipFile> attachmentZipFiles = new HashSet<ZipFile>();
        Iterator attachmentIterator = ((SaajSoapMessage)webServiceMessage).getAttachments();
        if(attachmentIterator != null) {
            while(attachmentIterator.hasNext()){
                attachmentZipFiles.add((ZipFile) attachmentIterator.next());
            }
        }
        return attachmentZipFiles;
    }
}
A: 

AXIOM message factory vs DOM Message Factory. DOM would not properly pick up attachments.

Jimbo