http 响应内容是一个 100mb 内容的肥皂消息。
messageFactory.createMessage(null, responseinputstream) 需要 3 到 4 分钟,而 responseSoapMessage.getSOAPBody() 需要另外 4 分钟或更长时间。在此之后,由于我在 WildFly 应用程序服务器中,因此事务超时。
MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
...
HttpEntity responseHttpEntity = httpResponse.getEntity();
...
InputStream responseContentStream = responseHttpEntity.getContent();
SOAPMessage responseSoapMessage = messageFactory.createMessage(null, responseContentStream);
SOAPBody responseSoapBody = responseSoapMessage.getSOAPBody();
在通过 MessageFactory 从 InputStream 创建 SOAPMessage 时,我想知道为什么需要这么长时间。
可能是由于一些 JAR 问题吗?我有两个 JARS 在玩:axis-1.4.jar 和 saaj-impl-1.3.jar
但是,在调试时,我发现使用的类是来自 saaj-impl-1.3.jar 的 SOAPMessageFactory1_2Impl。
尽管如此,我还是无法解释为什么跨越那两行代码需要超过 5 分钟。
这是响应 InputStream 中的 SOAP XML。
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ReceiveDocumentResponse xmlns="https://NAMESPACEURL">
<ReceiveDocumentResult>
<base64Binary>HERE IS THE JPG IMAGE CONTENT OF SIZE 100 MB OR MORE</base64Binary>
</ReceiveDocumentResult>
</ReceiveDocumentResponse>
</soap:Body>
</soap:Envelope>
请注意,对于小于 30 MB 的内容,此方法调用工作得相当好(快速)。
任何关于故障排除的提示,或任何用于解析内容的替代方法的提示,都非常感谢