gpt4 book ai didi

java - 如何从 Spring 中的 Soap 消息中提取附件

转载 作者:行者123 更新时间:2023-11-29 09:24:36 24 4
gpt4 key购买 nike

soap 消息成功到达,我可以很好地打印出信封,但附件始终为零。即使我通过 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;
}
}

最佳答案

AXIOM 消息工厂与 DOM 消息工厂。 DOM 无法正确拾取附件。

关于java - 如何从 Spring 中的 Soap 消息中提取附件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3688079/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com