Yesterday I had the same problem downloading large files. Finally, I was able to find a solution for this. Spring WS has a customized Axiom factory message called org.springframework.ws.soap.axiom.AxiomSoapMessageFactory , which can use the file instead of memory when loading large files. The only change in your configuration is to define a bean with your custom properties.
<bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory"> <property name="payloadCaching" value="false" /> <property name="attachmentCaching" value="true" /> <property name="attachmentCacheThreshold" value="1024"/> </bean>
Once you have this configuration and the Axiom classes available on the class path, Spring-ws automatically uses temporary files to copy large document loads.
source share