成功发现了肥皂消息,我可以打印好信封,但附件总是零。即使我通过SoapUI提出了确切的请求,并且附件显示正常。也许这不是提取附件的有效方法。我将它添加到sendandreceive方法。
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;
}
}
答案 0 :(得分:0)
AXIOM消息工厂与DOM消息工厂。 DOM无法正确获取附件。